bigquery job.promise() is not documented? and always polling at a fixed interval of 500ms?

from the bigquery job api I was only aware the complete event to listen to a job with a callback when job completed, till recently I found from some gist shared code I got that a job.promise() is available, since our application uses node v6 and recently upgraded to v8; the promise api fits the code better, and works with async await model; wonder should you at least document it?
https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery/0.9.6/bigquery/job
On the other hand, I spent some time figured out how was this default job.promise() working, I found the call trace down to the Operation's setTimeout self.startPolling of every 500ms, so it's polling at a hard coded interval of 500ms? while in many gcloud products best practices a backing off strategry of retrying is preferred,
https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/packages/common/src/operation.js#L184
this behavior of polling 500ms may be acceptable (or wanted) for some cases, for our ETL scripts which runs hundreds of query jobs concurrently in BATCH mode is just not so efficient, for this ETL purpose I have a piece of code already in use in production for a long while, implemented the backing off strategry, it supports an optional options obj parameters of waitbegin (default to 500ms) and waitmax (default to 10s)
// looping on a bigquery job till it's 'DONE' or error
//   using a backing off strategry, waiting starts with 500ms,
//     then increase by half till the max is 10s
function waitJobFinish(job, {waitbegin=500, waitmax=10000, initialState='UNKNOWN'} = {}) {
  return new Promise((fulfilled, rejected) =>
    function loop(retries=0, wait=waitbegin, state=initialState) {
      job.getMetadata()
        .catch(rejected)
        .then(([ metadata, apiResponse ]) => {
          if (metadata.status.state !== state) {
            console.log(`Job ${metadata.id} state transit from ${state} to ${metadata.status.state}, at ${(new Date).toJSON()} after ${retries} retries check job status.`);
            state = metadata.status.state;
          }

          if (metadata.status.errorResult)
            return rejected(metadata.status.errorResult);

          if (metadata.status.state === 'DONE')
            return fulfilled([ metadata, apiResponse, retries ]);

          setTimeout(loop, wait, retries+1, Math.min(waitmax, (wait+=wait/2)), state);
        });
    }() // (0, waitbegin, 'UNKNOWN')
  );
}

so with this API, it's similar to job.promise() we can write code like this, but internally it's doing a backing off strategy of retrying retrieve metadata;
  bigquery.startQuery({
    query: '...',
    // more options
  })
  .then(([ job ]) => waitJobFinish(job))
  .then(([ metadata, apiResponse, retries ]) => { ... })

or with async await
  // in an async function
  const [ job ] = await bigquery.startQuery(...);
  const [ metadata, apiResponse, retries ] = await waitJobFinish(job);
  // ...

the console.log lines give us transparency of how healthy each job runs, state transition from 'PENDING' to 'RUNNING' to 'DONE'
I'm not sure this strategy can be in the Operation for all the @google-cloud/... packages, but at least works for bigquery job; let me know if you like the code.

@stephenplusplus are there any reasons why we hardcode the polling interval and/or don't use a back off in operations?

I think that makes sense, although I can't find any official recommendations from the Google API docs. Do you know of any @c0b, or best practices in general for what should be our default?
Related: This was brought up in #1886, and discarded because GAPIC APIs already do backoff and allow configuration of retry parameters. Maybe we should look at what they do and copy it here.

I did a search "best practices backing off strategy site:cloud.google.com" got this doc on storage, and indeed saw more places (like errors trouble shooting guide) mentioned the exponential backoff strategy
https://cloud.google.com/storage/docs/exponential-backoff

If you get an error, use exponential backoff to avoid problems due to large traffic bursts.

another reason we need this is the bigquery API requests limit is 100/s isn't that big, my client side ETL script is constantly doing some hundreds of BATCH mode query, that could fill up the 100/s very soon get rateLimitError if use the job.promise()
https://cloud.google.com/bigquery/quotas

API requests per second, per user: If you make more than 100 requests per second, throttling might occur.

the (wait+=wait/2) isn't exactly exponential backoff described in the storage/docs/exponential-backoff link above, but easy to change to Math.min(maxwait, wait*=2)

The only thing I'm stuck on is we are talking about polling as opposed to error handling. We aren't retrying in the traditional sense, where the first request failed, so we must try again. We are only making a follow-up request because the job didn't complete yet. That's why I'm drawn to the constant interval, although I'm completely fine going with another value than 500ms, and/or allowing it to be configurable.
I'm also fine with introducing the backoff strategy that GAPIC uses, since it's probably safe to assume if they're doing it, it's the right thing for us to do. These are the options (source):

Name
Type
Description

initialRetryDelayMillis
number
the initial delay time, in milliseconds, between the completion of the first failed request and the initiation of the first retrying request.

retryDelayMultiplier
number
the multiplier by which to increase the delay time between the completion of failed requests, and the initiation of the subsequent retrying request.

maxRetryDelayMillis
number
the maximum delay time, in milliseconds, between requests. When this value is reached, retryDelayMultiplier will no longer be used to increase delay time.

initialRpcTimeoutMillis
number
the initial timeout parameter to the request.

rpcTimeoutMultiplier
number
the multiplier by which to increase the timeout parameter between failed requests.

maxRpcTimeoutMillis
number
the maximum timeout parameter, in milliseconds, for a request. When this value is reached, rpcTimeoutMultiplier will no longer be used to increase the timeout.

totalTimeoutMillis
number
the total time, in milliseconds, starting from when the initial request is sent, after which an error will be returned, regardless of the retrying attempts made meanwhile.

These are the default settings for longrunning operations (source):
{
  initialRetryDelayMillis: 100,
  retryDelayMultiplier: 1.3,
  maxRetryDelayMillis: 60000,
  initialRpcTimeoutMillis: null,
  rpcTimeoutMultiplier: null,
  maxRpcTimeoutMillis: null,
  totalTimeoutMillis: null
}

@callmehiphop WDYT?

I think that's fine, should we make a setter of some kind to allow users to configure these options?
operation
  .setPollingOptions({ retryDelayMultiplier: 2 })
  .on('error', console.errror)
  .on('complete', () => console.log('yay'));

?

That sounds nice, how would we handle the methods that handle job polling internally, e.g. https://github.com/GoogleCloudPlatform/google-cloud-node/blob/7160d17a3b3c0f3af4bff900cc9ac64831564498/packages/bigquery/src/table.js#L377? Accept a new option, like metadata.backoffSettings?

This issue was moved to googleapis/nodejs-bigquery#13


moon: 1.21.4 -> 1.22.3

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/moonrepo/moon/releases.
meta.description for moon is: A task runner and repo management tool for the web ecosystem, written in Rust
meta.homepage for moon is: https://github.com/moonrepo/moon
Updates performed

Rust version update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.22.0 with grep in /nix/store/4iqd4p57xklyzq83hz25xi05h54y7fac-moon-1.22.0
found 1.22.0 in filename of file in /nix/store/4iqd4p57xklyzq83hz25xi05h54y7fac-moon-1.22.0

Rebuild report (if merged into master) (click to expand)

1 total rebuild path(s)

1 package rebuild(s)

First fifty rebuilds by attrpath
moon

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/4iqd4p57xklyzq83hz25xi05h54y7fac-moon-1.22.0 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A moon https://github.com/r-ryantm/nixpkgs/archive/65d03ed2089cbf9efa4316e034ce086c9bf30d5d.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/65d03ed2089cbf9efa4316e034ce086c9bf30d5d#moon

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/4iqd4p57xklyzq83hz25xi05h54y7fac-moon-1.22.0
ls -la /nix/store/4iqd4p57xklyzq83hz25xi05h54y7fac-moon-1.22.0/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package built:

moon

Maintainer pings
cc @flemzord for testing.

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/moonrepo/moon/releases.
meta.description for moon is: A task runner and repo management tool for the web ecosystem, written in Rust
meta.homepage for moon is: https://github.com/moonrepo/moon
Updates performed

Rust version update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.22.3 with grep in /nix/store/daix47qzipxb48yzjbaibr4wamhn5l8x-moon-1.22.3
found 1.22.3 in filename of file in /nix/store/daix47qzipxb48yzjbaibr4wamhn5l8x-moon-1.22.3

Rebuild report (if merged into master) (click to expand)

1 total rebuild path(s)

1 package rebuild(s)

First fifty rebuilds by attrpath
moon

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/daix47qzipxb48yzjbaibr4wamhn5l8x-moon-1.22.3 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A moon https://github.com/r-ryantm/nixpkgs/archive/381e42267fd3aa49f891f95b6ee22a6ede324831.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/381e42267fd3aa49f891f95b6ee22a6ede324831#moon

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/daix47qzipxb48yzjbaibr4wamhn5l8x-moon-1.22.3
ls -la /nix/store/daix47qzipxb48yzjbaibr4wamhn5l8x-moon-1.22.3/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review --extra-nixpkgs-config '{ allowInsecurePredicate = x: true; }' run on x86_64-linux 1

1 package built:

moon

Maintainer pings
cc @flemzord for testing.

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/moonrepo/moon/releases.
meta.description for moon is: A task runner and repo management tool for the web ecosystem, written in Rust
meta.homepage for moon is: https://github.com/moonrepo/moon
Updates performed

Rust version update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.22.4 with grep in /nix/store/6wsz8vkphx9ain24i17jsb736vbddx2a-moon-1.22.4
found 1.22.4 in filename of file in /nix/store/6wsz8vkphx9ain24i17jsb736vbddx2a-moon-1.22.4

Rebuild report (if merged into master) (click to expand)

1 total rebuild path(s)

1 package rebuild(s)

First fifty rebuilds by attrpath
moon

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/6wsz8vkphx9ain24i17jsb736vbddx2a-moon-1.22.4 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A moon https://github.com/r-ryantm/nixpkgs/archive/f8429622e83fd7d520e783bcd7661bf6c32a2504.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/f8429622e83fd7d520e783bcd7661bf6c32a2504#moon

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/6wsz8vkphx9ain24i17jsb736vbddx2a-moon-1.22.4
ls -la /nix/store/6wsz8vkphx9ain24i17jsb736vbddx2a-moon-1.22.4/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review --extra-nixpkgs-config '{ allowInsecurePredicate = x: true; }' run on x86_64-linux 1

1 package built:

moon

Maintainer pings
cc @flemzord for testing.


[BEAM-2530] Automatically retrieving JDK 11 containers in Dataflow

r: @aaltay
r: @mwalenia

@pabloem LGTM, thanks!

@aaltay does this look fine to you?

Question, raised from somewhere else:
Could dataflow just use a java11 based container to run both java8 and java11 pipelines? Would not java11 JVM will be compatible with java8 built files?

TBH I dont know what the answer is to this. Maybe yes? I'd like to hear from someone with more java knowledge.

@kennknowles Do you know if Java 11 JVM can backward compatibly run packages built with Java 8? Does Dataflow need a period of time where it offers Java 8 and Java 11 containers?

Yes, I believe JDK 11 can run JDK 8 compiled code. I'm not aware of any breaking change in this direction.

I would trust @lukecwik or @adude3141 opinion more than my own.

Unfortunately I do not fully understand the changes here.
I assume we are talking about some container, a beam pipeline is run with? I.e. the container is running beam code and user code.
I further assume, the customer is allowed to provide her code compiled with java8. So will likely not test on java11 herself, but that containers java version would be kind of transparent to her.
Now given a business critical pipeline depending on some third-party library which can not easily be replaced nor upgraded. Which in turn depends for instance on some byte code enhancement lib or does such simple things as
(URLClassLoader) getClass().getClassLoader()
which, iirc does not work anymore on java11 (or some such I do not remember).
Wouldn't that mean, that this customer is suddenly locked out of the service? Always assuming that for whatever reason it is not feasible to upgrade those deps.


fastfetch 2.0.5-8 (x86_64) kitty-direct

When I run ./build/fastfetch --logo-type kitty-direct --logo ~/Pictures/OpenSuse.png, the logo shows up a large size.
Also I get this error message: Logo (kitty-direct): fail to query cursor position: poll() timeout or failed.
I filled the whole thing out earlier, and then I accidentally when back in my browser and lost it. I am not doing all of that again. But I think one of the commands said that fastfetch was not compiled with a bunch of stuff.
Next time I will use me freaking text editor to do this.

What terminal were you using?

I reproduced this issue with a very large image. Then I resized the image to a smaller size, fastfetch worked fine.


Capture physical keyboard / remote control scroll

Hello
I'm using CarouselView on an Android TV app
In order to get it certified by Amazon (for Fire TV devices) it is required to allow scrolling using physical keys (keyboard or remote control)
Would any one be able to help me on this?
I appreciate your feedback
Regards

Do you have an idea to which key_down it is translated?

no i don't .. sorry
i had to make a custom package for FireTV without CarouselView .. until this enhancement will be released
thank you in advance


Wildcard support in query parameters

I haven't found a way to get the wildcard (%) inserted automatically in to a query parameter.  This would be useful for cases the query parameter is followed by a LIKE clause.  Wrapping the parameter name using the wildcard character within the metadata file (ie - ...where xyz like %:querystring%) does not seem to work.  Can this be made possible?  Or if not, can the template be extended to provide a tip to the user that they need to insert the wildcard characters themselves?

This is a little bit fiddly, but it's possible to do it using SQLite string concatenation. Here's an example:
select * from facetable where neighborhood like "%" || :text || "%";

Try it here: https://latest.datasette.io/fixtures-35b6eb6?sql=select+*+from+facetable+where+neighborhood+like+"%25"+||+%3Atext+||+"%25"%3B&text=town

Does that solve your problem?

I've added this to the unit tests and the documentation.
Docs: http://datasette.readthedocs.io/en/latest/sql_queries.html#canned-queries
New canned query demo: https://latest.datasette.io/fixtures-cafd088/neighborhood_search?text=town

Perfect, thank you!!

One thing I've noticed with this approach is that the query is executed with no parameters which I do not believe was the case previously.  In the case the table contains a lot of data, this adds some time executing the query before the user can enter their input and run it with the parameters they want.

This seems to fix that:
select neighborhood, facet_cities.name, state
from facetable
    join facet_cities on facetable.city_id = facet_cities.id
where :text != "" and neighborhood like '%' || :text || '%'
order by neighborhood;

Compare this (with empty string): https://latest.datasette.io/fixtures-cafd088?sql=select+neighborhood%2C+facet_cities.name%2C+state
from+facetable
++++join+facet_cities+on+facetable.city_id+%3D+facet_cities.id
where+%3Atext+!%3D+""+and+neighborhood+like+'%25'+||+%3Atext+||+'%25'
order+by+neighborhood%3B
To this: https://latest.datasette.io/fixtures-cafd088?sql=select+neighborhood%2C+facet_cities.name%2C+state
from+facetable
++++join+facet_cities+on+facetable.city_id+%3D+facet_cities.id
where+%3Atext+!%3D+""+and+neighborhood+like+'%25'+||+%3Atext+||+'%25'
order+by+neighborhood%3B&text=town

Those queries look identical.  How can this be prevented if the queries are in a metadata.json file?

I may have misunderstood your problem here.
I understood that the problem is that when using the "%" || :text || "%" Co strict the first hit to that page (with an empty string for :text) results in a where neighborhood like "%%" query which is slow because it matches every row in the database.
My fix was to add this to the where clause:
where :text != '' and ...

Which means that when you first load the page the where fails to match any rows and you get no results (and hopefully instant loading times assuming SQLite is smart enough to optimize this away). That's why you don't see any rows returned on this page: https://latest.datasette.io/fixtures-cafd088?sql=select+neighborhood%2C+facet_cities.name%2C+state
from+facetable
++++join+facet_cities+on+facetable.city_id+%3D+facet_cities.id
where+%3Atext+!%3D+""+and+neighborhood+like+'%25'+||+%3Atext+||+'%25'
order+by+neighborhood%3B

Oh I see..  My issue is that the query executes with an empty string prior to the user submitting the parameters.  I'll try adding your workaround to some of my queries.  Thanks again,


Cannot import Ajv

when I import Ajv in typescript
import Ajv from 'ajv/dist/ajv.js';

chrome return this error
Uncaught SyntaxError: The requested module './../../node_modules/ajv/dist/ajv.js' does not provide an export named 'default' (at validator.ts:1:8)

why does this issue happen?
thanks

I don't think this is a great solution, but the way I worked around this is to change the extension of my TypeScript file to be .cts. That tells TypeScript to compile this a CommonJs file, and will give it a .cjs extension once compiled. My current project is not creating a single bundled file, and is only for server-side Node execution, so this solution may not work for you.
Anyway, once I did the above, I could do an import as you show, as well as import types. For example:
import Ajv from 'ajv/dist/jtd.js';
import type { JTDDataType } from 'ajv/dist/jtd.js';

const ajv = new Ajv();

This is not a logical way
I can't repeat this every time I install ninety modules
This package; It is not a small package
I wonder why I encountered this problem and did not find a solution

@njfamirm

This is not a logical way

Nothing is logical about Node ESM support by typescript.

I can't repeat this every time I install ninety modules

Repeat what? That's a typescript approved™ way of handling the difference between CJS and MJS.

This package; is not a small package

How is it relevant to the module system of this package? You would have the same problem with a hello world written in an ESM typescript too.

I wonder why I encountered this problem and did not find a solution

The underlying problem is typescript versioning being driven by marketing above all else, so it's perfectly possible the old type code randomly breaking in a minor/patch typescript release.
This issue is only going to get more pronounced as more packages support Node ESM, so when you have random import problems, try these steps first:

Try to call default key of the default import:import name from "module-path"`;
name.default();

Rewrite into the default import: import { default as name } from "module-path";
Rewrite into named import: import { name } from "module-path";

I fix it with rollup commonjs resolver!

@njfamirm thank you! It worked for me too, using Rollup v4.


Pass options to helpers

This is so helpers can pass the parent helpers to child templates.
Thanks @whitecolor. Fixes #1783

Thanks.


Shelly i4 not discovered

I Have 2 Shelly I4's which i've configured to use MQTT with both RPC status notifications over MQTT and Generic status update over MQTT enabled.
I've installed shellies_discovery_gen2.py through HACS and added the minimal automations configuration.
I've got the feeling that i'm missing something or forgot to do something.
Could you point me in the right direction ??
Describe the bug/Problem

Devices are not showing up in Home Assistant
Expected behavior

Devices show up in Home Assistant
Versions:

Home Assistant: 2021.12.5
Shellies Discovery GEN2:  1.1.2
Shelly device firmware:
Device ID: 083AF2015038
Firmware version: i4prod1
Firmware build ID: 20220120-094630/i4prod1-g480b553
Web build ID: 1.5.5-1729906

Shellies Discovery GEN2 automation:

- id: shellies_announce_gen2
  alias: "Shellies Announce Gen2"
  trigger:
    - platform: homeassistant
      event: start
  variables:
    device_info_payload:  "{{ {'id': 1, 'src':'shellies_discovery', 'method':'Shelly.GetConfig'} | to_json }}"
  action:
    - service: mqtt.publish
      data:
        topic: "shellypro4pm-aabbccddeeff/rpc"  # shellypro4pm-aabbccddeeff is a device ID
        payload: "{{ device_info_payload }}"
    - service: mqtt.publish
      data:
        topic: "shellyplus1pm-112233445566/rpc"  # shellyplus1pm-112233445566 is a device ID
        payload: "{{ device_info_payload }}"

- id: shellies_discovery_gen2
  alias: "Shellies Discovery Gen2"
  mode: queued
  max: 999
  trigger:
  - platform: mqtt
    topic: shellies_discovery/rpc
  action:
  - service: python_script.shellies_discovery_gen2
    data:
      id: "{{ trigger.payload_json.src }}"
      device_config: "{{ trigger.payload_json.result }}"

- id: shellies_status_gen2
  alias: "Shellies Status Gen2"
  trigger:
  - platform: time_pattern
    minutes: "/15"
  - platform: homeassistant
    event: start
  action:
  - service: mqtt.publish
    data:
      topic: shellypro4pm-aabbccddeeff/rpc
      payload: "{{ {'id': 1, 'src':'shellypro4pm-aabbccddeeff/status', 'method':'Shelly.GetStatus'} | to_json }}"  # shellypro4pm-aabbccddeeff is a device ID
  - service: mqtt.publish
    data:
      topic: shellyplus1pm-112233445566/rpc
      payload: "{{ {'id': 1, 'src':'shellyplus1pm-112233445566/status', 'method':'Shelly.GetStatus'} | to_json }}"  # shellyplus1pm-112233445566 is a device ID

Debug log:

You have to add your device ID to the automations.


[CUSTOM PLUGIN MIGRATE] POSTGRES Support with ID with (INTEGER) SERIAL PK?

Summary
Custom Plugin Migration doesn't support Postgresql (INTEGER) SERIAL PK?
Does it meant to be PK must be UUID always?
or it's just dao.db.postgres 's find_all doesn't support with INTEGER type id column?
cause I can't find anywhere PSQL's ID must be an UUID type not INTEGER.
(https://getkong.org/docs/0.11.x/plugin-development/custom-entities/)
kong/dao/db/postgres.lua 's find_all method query is like
https://github.com/Kong/kong/blob/master/kong/dao/db/postgres.lua#L267-L273
SELECT (columns) FROM myPlugin
LEFT OUTER JOIN ttls ON (myPlugin.id = ttls.primary_uuid_value)                                                                                WHERE (ttls.primary_key_value IS NULL
OR (ttls.table_name = 'myPlugin' AND expire_at > CURRENT_TIMESTAMP(0) at time zone 'utc'))

and if myPlugin.id type is Integer, ttls.primary_uuid_value is "TEXT" so it conflicts.
NGX ERR
2017/11/06 06:36:55 [crit] 18179#0: *10 [lua] api.lua:29: [postgres error] ERROR: operator does not exist: integer = text (264), client: <IP_ADDRESS>, server: kong_admin,

If ID column was meant to be UUID column always, please update the documents.
(It's pretty confusing.)
Steps To Reproduce

Create custom plugin with migration/postgres.lua

return {
  {
    name = "2016-11-01-172400_init_myPlugin",
    up = [[
      CREATE TABLE IF NOT EXISTS myPlugin
      (
          id INTEGER SERIAL PRIMARY KEY NOT NULL,
          module TEXT NOT NULL,
      );
    ]],
    down = [[
      DROP TABLE myPlugin;
    ]]
  }
}

migration up
from in your plugin, call dao.myPlugin:find_all() with no arguments (for fetch all rows)
get some fear with [postgres error] ERROR: operator does not exist: integer = text (264)

Additional Details & Logs

Kong version ($ kong version - v0.11.1)
Kong debug-level startup logs ($ kong start --vv)

2017/11/06 07:13:11 [verbose] Kong: 0.11.1
2017/11/06 07:13:11 [debug] ngx_lua: 10008
2017/11/06 07:13:11 [debug] nginx: 1011002
2017/11/06 07:13:11 [debug] Lua: LuaJIT 2.1.0-beta2
2017/11/06 07:13:11 [verbose] no config file found at /etc/kong/kong.conf
2017/11/06 07:13:11 [verbose] no config file found at /etc/kong.conf
2017/11/06 07:13:11 [verbose] no config file, skipping loading
2017/11/06 07:13:11 [debug] admin_access_log = "logs/admin_access.log"
2017/11/06 07:13:11 [debug] admin_error_log = "logs/error.log"
2017/11/06 07:13:11 [debug] admin_http2 = false
2017/11/06 07:13:11 [debug] admin_listen = "<IP_ADDRESS>:8001"
2017/11/06 07:13:11 [debug] admin_listen_ssl = "<IP_ADDRESS>:8444"
2017/11/06 07:13:11 [debug] admin_ssl = true
2017/11/06 07:13:11 [debug] anonymous_reports = true
2017/11/06 07:13:11 [debug] cassandra_consistency = "ONE"
2017/11/06 07:13:11 [debug] cassandra_contact_points = {"<IP_ADDRESS>"}
2017/11/06 07:13:11 [debug] cassandra_data_centers = {"dc1:2","dc2:3"}
2017/11/06 07:13:11 [debug] cassandra_keyspace = "kong"
2017/11/06 07:13:11 [debug] cassandra_lb_policy = "RoundRobin"
2017/11/06 07:13:11 [debug] cassandra_port = 9042
2017/11/06 07:13:11 [debug] cassandra_repl_factor = 1
2017/11/06 07:13:11 [debug] cassandra_repl_strategy = "SimpleStrategy"
2017/11/06 07:13:11 [debug] cassandra_schema_consensus_timeout = 10000
2017/11/06 07:13:11 [debug] cassandra_ssl = false
2017/11/06 07:13:11 [debug] cassandra_ssl_verify = false
2017/11/06 07:13:11 [debug] cassandra_timeout = 5000
2017/11/06 07:13:11 [debug] cassandra_username = "kong"
2017/11/06 07:13:11 [debug] client_body_buffer_size = "8k"
2017/11/06 07:13:11 [debug] client_max_body_size = "0"
2017/11/06 07:13:11 [debug] client_ssl = false
2017/11/06 07:13:11 [debug] custom_plugins = {}
2017/11/06 07:13:11 [debug] database = "postgres"
2017/11/06 07:13:11 [debug] db_cache_ttl = 3600
2017/11/06 07:13:11 [debug] db_update_frequency = 5
2017/11/06 07:13:11 [debug] db_update_propagation = 0
2017/11/06 07:13:11 [debug] dns_error_ttl = 1
2017/11/06 07:13:11 [debug] dns_hostsfile = "/etc/hosts"
2017/11/06 07:13:11 [debug] dns_no_sync = false
2017/11/06 07:13:11 [debug] dns_not_found_ttl = 30
2017/11/06 07:13:11 [debug] dns_order = {"LAST","SRV","A","CNAME"}
2017/11/06 07:13:11 [debug] dns_resolver = {}
2017/11/06 07:13:11 [debug] dns_stale_ttl = 4
2017/11/06 07:13:11 [debug] error_default_type = "text/plain"
2017/11/06 07:13:11 [debug] http2 = false
2017/11/06 07:13:11 [debug] latency_tokens = true
2017/11/06 07:13:11 [debug] log_level = "notice"
2017/11/06 07:13:11 [debug] lua_package_cpath = ""
2017/11/06 07:13:11 [debug] lua_package_path = "./?.lua;./?/init.lua;"
2017/11/06 07:13:11 [debug] lua_socket_pool_size = 30
2017/11/06 07:13:11 [debug] lua_ssl_verify_depth = 1
2017/11/06 07:13:11 [debug] mem_cache_size = "128m"
2017/11/06 07:13:11 [debug] nginx_daemon = "on"
2017/11/06 07:13:11 [debug] nginx_optimizations = true
2017/11/06 07:13:11 [debug] nginx_user = "nobody nobody"
2017/11/06 07:13:11 [debug] nginx_worker_processes = "auto"
2017/11/06 07:13:11 [debug] pg_database = "kong"
2017/11/06 07:13:11 [debug] pg_host = "<IP_ADDRESS>"
2017/11/06 07:13:11 [debug] pg_port = 5432
2017/11/06 07:13:11 [debug] pg_ssl = false
2017/11/06 07:13:11 [debug] pg_ssl_verify = false
2017/11/06 07:13:11 [debug] pg_user = "kong"
2017/11/06 07:13:11 [debug] prefix = "/usr/local/kong/"
2017/11/06 07:13:11 [debug] proxy_access_log = "logs/access.log"
2017/11/06 07:13:11 [debug] proxy_error_log = "logs/error.log"
2017/11/06 07:13:11 [debug] proxy_listen = "<IP_ADDRESS>:8000"
2017/11/06 07:13:11 [debug] proxy_listen_ssl = "<IP_ADDRESS>:8443"
2017/11/06 07:13:11 [debug] real_ip_header = "X-Real-IP"
2017/11/06 07:13:11 [debug] real_ip_recursive = "off"
2017/11/06 07:13:11 [debug] server_tokens = true
2017/11/06 07:13:11 [debug] ssl = true
2017/11/06 07:13:11 [debug] ssl_cipher_suite = "modern"
2017/11/06 07:13:11 [debug] ssl_ciphers = "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256"
2017/11/06 07:13:11 [debug] trusted_ips = {}
2017/11/06 07:13:11 [debug] upstream_keepalive = 60
2017/11/06 07:13:11 [verbose] prefix in use: /usr/local/kong
2017/11/06 07:13:11 [verbose] preparing nginx prefix directory at /usr/local/kong
2017/11/06 07:13:11 [verbose] SSL enabled, no custom certificate set: using default certificate
2017/11/06 07:13:11 [verbose] default SSL certificate found at /usr/local/kong/ssl/kong-default.crt
2017/11/06 07:13:11 [verbose] Admin SSL enabled, no custom certificate set: using default certificate
2017/11/06 07:13:11 [verbose] admin SSL certificate found at /usr/local/kong/ssl/admin-kong-default.crt
2017/11/06 07:13:11 [debug] searching for OpenResty 'nginx' executable
2017/11/06 07:13:11 [debug] /usr/local/openresty/nginx/sbin/nginx -v: 'nginx version: openresty/<IP_ADDRESS>'
2017/11/06 07:13:11 [debug] found OpenResty 'nginx' executable at /usr/local/openresty/nginx/sbin/nginx
2017/11/06 07:13:11 [debug] starting nginx: /usr/local/openresty/nginx/sbin/nginx -p /usr/local/kong -c nginx.conf
2017/11/06 07:13:11 [verbose] could not start Kong, stopping services
2017/11/06 07:13:11 [verbose] stopped services

Kong error logs (<KONG_PREFIX>/logs/error.log)  [postgres error] ERROR: operator does not exist: integer = text (264)
Kong configuration (registered APIs/Plugins & configuration file) Default Config
Operating System
kong-vagrant  ubuntu/trusty64

Hi,
What is the content of your schema.lua (or daos.lua) file? It is indeed very likely that you must specify UUIDs for your entities primary keys. The main reason behind this is interoperability between the two databases supported by Kong, PostgreSQL and Cassandra. Yes, it would be nice to have this specified in the plugins development documentation!


Updating the CASE topic for Synapse SQL

Synapse SQL supports both case options.

@TwoUnder : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@TwoUnder : Thanks for your contribution! The author(s) have been notified to review your proposed change.


Runtime parameters of mlcube can't include the letter "h"

Setting runtime parameters using the -P... convention doesn't work if the parameter contains the letter h. Example:
mlcube run -Pdocker.cpu_args="--shm-size 1g" ...
Running the above will show the MLCube's --help message.
Below as an example that can localize the problem:
mlcube run -Pdocker.cpu_args="--name helloworld" ...: This will show the --help message
mlcube run -Pdocker.cpu_args="--name elloworld" ...: This will run successfuly
The reason seems to be that when click encounters the following pattern: -**********h******, it interprets this as a bunch of options, and recognizes one of them: -h.
I couldn't find a workaround, and I think in the future we will need to allow users to dynamically set docker's --shm-size parameter.

Thanks @hasan7n for reporting this. Will look at it on Friday.

@hasan7n  Ok, so it should be fixed in #348.
Brief description of the cause of the behavior. We've gone through multiple rounds of refactoring of the MLCube command line interface, and at some point in time option descriptions moved to their module (cli) while deprecated option declarations remained in the __main__.py file. The secondary cause of this bug was that we updated APIs of most of MLCube CLI commands, but did not do that for the run command that continued to use the old interface. After updating its API to match APIs of other commands (such as configure), this bug went away.
The main cause however was the following. The run command did not expose any arguments for the MLCube parameters (e.g., -Pdocker.cpu_args="--shm-size 1g"). Turns out that the click library makes various attempts to parse options/arguments and match them with the long/short aliases of the arguments. The following was hapenning:

The -Pdocker.cpu_args="--shm-size 1g" string is correctly split into name (-Pdocker.cpu_args) and value (--shm-size 1g).
The click library was trying to match the name against known aliases (long names) of options, and was obviously failing.
Then, it was trying to do fuzzy matching what also was resulting in empty matches.
At this point in time (I have not spent too much time identifying the exact logic) the click library considers the entire string -Pdocker.cpu_args="--shm-size 1g as multiple short options, that seems to be consistent with other tools, e.g, one can run ls -al which is the same as ls -l -a. So, the click  library removes the first character (-) and then iterates one character at a time considering options such as -P, -d, -o etc. and eventually -h. All options happen to be unknown except the latter, which is the cause for click to display help message.

As you correctly mention, when there's no h, this bug does not manifest itself.

Associated PR #348 fixed this problem.


[fetch-plans] Fetch plans on-demand.

https://trello.com/c/Z8uWlkKD

@jgerigmeyer @wlonk running yarn test should give you the jest (excuse the pun) of the current state of front end tests.  I can also leave notes about specific things that I couldn't figure out.
Also, there may be one requirement for this story I think that's missing which is: adding a plan as null when fetched and displaying a 404.


I have an idea....

How about adding durability to save data in the cache?.
Like this package, you can add the time that files are stored in your cache.
Link: https://github.com/Baseflow/flutter_cache_manager/tree/develop/flutter_cache_manager

thanks, it is already added
please check this link
https://github.com/AbdOoSaed/flutter_cached_pdfview/blob/6d1aa21df5e2c48e20f492b794cddae86bbc1ffd/lib/src/pdf_view_types.dart#L38


Files imported through cdn cannot be displayed; Vite + Vue3

Environment:

Vue Version: 3.3.0

vue-pdf-embed Version: 2.0.0、2.0.2

UserAgent:  Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Mobile Safari/537.36

Build Tool: Vite

Code Snippet:

Rendering-failed:
TypeError: Cannot read properties of undefined (reading 'children')
   at index.umd.js:28:3543
   at async Promise.all (:5173/index 0)
   at async G (index.umd.js:28:3387)

Files imported through cdn cannot be displayed;
But the other way is normal;
eg: npm install vue-pdf-embed import VuePdfEmbed from 'vue-pdf-embed'
How to solve, please help me;

How did you solve it?

How did you solve it?

@mynameismaosheng @Linkodt
I solved it.
`
import * as V from 'vue';
window.vue = V;
window.Vue = V;
`


Hide the red dot in LHN when the request is settled

Details

Hide the red dot in LHN when the request is settled
Fixed Issues

$ https://github.com/Expensify/App/issues/33998
PROPOSAL: https://github.com/Expensify/App/issues/33998#issuecomment-1878088906
Tests

Create a workspace and invite some users to workspace
As employee, go to the policy expense chat
Create a scan request
Go to request detail report
Edit the amount and verify that the red dot appear in LHN
As admin, paid this request and verify that the red dot disappears from the policy expense chat in LHN

[x] Verify that no errors appear in the JS console

Offline tests

Same as above
QA Steps

Create a workspace and invite some users to workspace
As employee, go to the policy expense chat
Create a scan request
Go to request detail report
Edit the amount and verify that the red dot appear in LHN
As admin, paid this request and verify that the red dot disappears from the policy expense chat in LHN

[x] Verify that no errors appear in the JS console

PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android: Native
[x] Android: mWeb Chrome
[x] iOS: Native
[x] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[x] MacOS: Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method

[x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[x] If the PR modifies the form input styles:

[x] I verified that all the inputs inside a form are aligned with each other.
[x] I added Design label so the design team can review the changes.

[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
https://github.com/Expensify/App/assets/129500732/a9634d6b-2440-4d67-916f-09d6ead94ca4

Android: mWeb Chrome
https://github.com/Expensify/App/assets/129500732/944de03b-4e52-45b0-864a-9d80284bf534

iOS: Native
https://github.com/Expensify/App/assets/129500732/5c0a5b52-4f54-4694-a432-b781a4e68d58

iOS: mWeb Safari
https://github.com/Expensify/App/assets/129500732/a8a44240-ddd4-4e68-b45f-00f4b7202ef4

MacOS: Chrome / Safari
https://github.com/Expensify/App/assets/129500732/c34182f0-bf4f-4254-bc6d-8c121cc3dcc6

MacOS: Desktop
https://github.com/Expensify/App/assets/129500732/2013c3f6-7a54-4a3c-acd1-c7484bd1197f

Reviewer Checklist

[ ] I have verified the author checklist is complete (all boxes are checked off).
[ ] I verified the correct issue is linked in the ### Fixed Issues section above
[ ] I verified testing steps are clear and they cover the changes made in this PR

[ ] I verified the steps for local testing are in the Tests section
[ ] I verified the steps for Staging and/or Production testing are in the QA steps section
[ ] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[ ] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[ ] I checked that screenshots or videos are included for tests on all platforms
[ ] I included screenshots or videos for tests on all platforms
[ ] I verified tests pass on all platforms & I tested again on:

[ ] Android: Native
[ ] Android: mWeb Chrome
[ ] iOS: Native
[ ] iOS: mWeb Safari
[ ] MacOS: Chrome / Safari
[ ] MacOS: Desktop

[ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
[ ] I verified proper code patterns were followed (see Reviewing the code)

[ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[ ] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[ ] I verified that comments were added to code that is not self explanatory
[ ] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[ ] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[ ] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[ ] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[ ] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[ ] I verified the JSDocs style guidelines (in STYLE.md) were followed

[ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[ ] I verified that this PR follows the guidelines as stated in the Review Guidelines
[ ] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
[ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[ ] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[ ] If a new component is created I verified that:

[ ] A similar component doesn't exist in the codebase
[ ] All props are defined accurately and each prop has a /** comment above it */
[ ] The file is named correctly
[ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[ ] The only data being stored in the state is data necessary for rendering and nothing else
[ ] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[ ] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[ ] All JSX used for rendering exists in the render method
[ ] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[ ] If any new file was added I verified that:

[ ] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[ ] If a new CSS style is added I verified that:

[ ] A similar style doesn't already exist
[ ] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)

[ ] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[ ] If the PR modifies the form input styles:

[ ] I verified that all the inputs inside a form are aligned with each other.
[ ] I added Design label so the design team can review the changes.

[ ] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[ ] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native

Android: mWeb Chrome

iOS: Native

iOS: mWeb Safari

MacOS: Chrome / Safari

MacOS: Desktop

The bug is about a member of workspace requesting money and the red dot not disappearing after admin pays it.
The test steps look like admin themselves are requesting the money and paying it.
Please change the step of requesting money to requesting money from a member of the workspace.

Yes but I think it is better to have the QA steps with member and admin separate because it is the more common use case and in line with the identified bug steps.

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.25-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
failure ❌

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/mountiny in version: 1.4.25-10 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
failure ❌

🕸 web 🕸
success ✅


refactor [#27]: Refactored BTree::combines to reduce complexity and c…

…ode duplication

By submitting this pull request I confirm I've read and complied with the below requirements.

[ ] I have read the Contribution guidelines and I am confident that my PR reflects them.
[ ] I have followed the coding guidelines for this project.
[ ] My code follows the skeleton code structure.
[ ] This pull request has a descriptive title. For example, Added {Algorithm/DS name} [{Language}], not Update README.md or Added new code.

This should reduce the CC of the function with ~43%


Unable to add branch and log slabs to config

Hi, I want to add compatibility for the Lord of the Rings mod for 1.16.5. I added the tags under logs_whitelisted and the game crashes when loading up. How can I add tags or the branch name lotr:oak_branch?
#The tag that blocks must have to be considered choppable (default: treechop:choppables)
blockTagForDetectingLogs = "treechop:choppables", "lotr:log_slabs"
#The tag that blocks must have to be considered leaves (default: treechop:leaves_like)
blockTagForDetectingLeaves = "treechop:leaves_like"

TreeChop for 1.16.5 only allows one block tag to be specified in the config. So, you’d need to make a datapack to add blocks to the treechop:choppables tag, or better yet, minecraft:logs_that_burn, which is included in the treechop tag
If you don’t wanna make a datapack, there might be a mod out there to help with fixing block tag issues. I believe there’s one for Fabric, not sure about Forge.
Either way, the best fix would be to ask the LotR mod devs to give their log and leaves blocks the appropriate block tags

Closing, feel free to reopen if you're still having issues


Typescript not inferring object property types

I feel like TS has all necessary info to infer the types in this screenshot.
Is there another way to achieve this?

Please, don't use a screenshot as code, paste it as text.
Any key of type Styles can be either an object or a function. In line 19 typescript don't known witch one is so it warns you that it cannot be a function.


include cs file

I havent been able to replicate the command include in python.
e.g.,:
include $ORIGIN/my_peripheral.cs
what is the correct pyrenode3 syntax for this?

What I ended doing is
e = Emulation()
res = m.Parse("include @/my_file.cs")

 monitor.execute_script("include @/my_file.cs")?

Did not work. I think that is just for python scripts.
https://github.com/renode/renode-infrastructure/blob/f97a79fc41999a6960ac3d9eb1df5feed54d1fec/src/Emulator/Extensions/UserInterface/Monitor.cs#L613


Fix some typos

I noticed some typos and have corrected them.

Fixed some typos in comments
Fixed a typo in an error message

which are separated into two separate commits.

Thanks!


chore(maintainers): GitMuslim -> mustafakhalaf-git

@mustafakhalaf-git can you confirm your happy with this change? or would you prefer to be removed?

yeah I want to be removed entirely for now, thanks.


[website] Broken link: Open function in GitHub

Expected behavior
The “Open function in GitHub” should open the function in GitHub (and not 404).
Description of bug

Good find, thanks! Just patched.


Update requirements and dependencies

Closes #21

update of fs-extra directly in develop

update of fs-extra directly in develop


[RESOLVED] Interface eth0(): High error rate (>2 for 5m)

Problem started at 08:30:29 on 2023.08.11
Problem name: Interface eth0(): High error rate (>2 for 5m)
Host: S100-Primario
Severity: Warning
Operational data: errors in: 1, errors out: 0
Original problem ID: 35258
Event details in Zabbix: http://<IP_ADDRESS>/tr_events.php?triggerid=23483&eventid=35258

Problem has been resolved in 9m 0s at 08:39:29 on 2023.08.11
Problem name: Interface eth0(): High error rate (>2 for 5m)
Host: S100-Primario
Severity: Warning
Original problem ID: 35258


Some (naive) SparseBitSet benchmarks for comparison

Upgraded to the latest JMH (1.10.1) and added a SparseBitSet construction benchmark

Excellent.


Rework GPIO debounce to save area

Use a shared debounce counter for all pins, rather than a counter each.

Reduces u_gpio resource usage to around 410 LUTs & 904 Flops according to report_utilization -hierarchical.

Reduces u_gpio resource usage to around 410 LUTs & 904 Flops

Was hoping we'd get it down yet more but I guess we need a handful of flops per GPIO due to the sync flops as well as the output/output enable and debounce stuff. I guess we could only put debounce on a subset of the GPIOs but probably won't save us that much.

This looks great thanks Eliot!
Can we just replace the existing debounce module, i.e. remove it and rename debounce_step?

I looked at this but debounce is still used in the reset controller.


Image saving

Coverage increased (+0.48%) to 56.22% when pulling e92e5815f943ef4e1e5755d7f0feb073be871a9c on image-saving into 95ac8c27373db34d61c2eb21704606dada4dd7df on v1.1.


Explore alternatives to RustPython for Python AST parsing

RustPython has been a good foundation, but Ruff is currently limited by what the RustPython parser does and does not support. See: #282, #54, #245.
Since we only need the parser (and RustPython is more ambitious -- they're trying to build an entire runtime / interpreter), there may be better options. RustPython is also going to be limited by their use of an LL(1) parser.
We could consider using the following:

https://github.com/tree-sitter/tree-sitter-python
https://github.com/pest-parser/pest
https://github.com/kevinmehall/rust-peg

Alternatively, could we use the CPython AST parser directly? It's written in C, AFAIK it should be very fast (perhaps even faster than the RustPython parser).

Alternatively, we could revisit the use of LibCST.

LibCST will also likely be required for auto-formatting.

tree-sitter is an interesting option (demo in #295). It produces a CST, so we could use it to power auto-formatting. It's slower than RustPython but still quite fast (~350ms to iterate over the CPython codebase vs. ~230ms with RustPython). Because it's based on S-expressions, it has a whole pattern-matching syntax built-in, which we could use to power plugins...
I think the ergonomics on our end won't be great, because it just exposes a single Node type with a kind: &str field, and so we'd have to do all pattern-matching on string identifiers rather than encoding the AST in a type system. It also may not map 1:1 with the abstract grammar, I'm not certain.
Going to explore a few other options, but I'm intrigued...

There's also rust-python-parser, which is based on nom.

There's also rust-sitter, which sits on top of tree-sitter and lets you define the grammar on the Rust side via macros. In return, you get semantically meaningful structs when you generate the parse tree. The downside is that we'd have to re-write the Python grammar ourselves. (Also, the project doesn't look like it has a ton of traction.)

If we were to use tree-sitter, we may want to write code to transform the generated tree into AST types on the Rust side, similar to the RustPython AST. (That would have to be closer to a CST, though.)

rust-python-parser takes ~480ms (vs. 280ms for RustPython's parser) and fails on these files:
resources/test/cpython/Lib/_compression.py
resources/test/cpython/Lib/ast.py
resources/test/cpython/Lib/contextlib.py
resources/test/cpython/Lib/distutils/tests/test_sysconfig.py
resources/test/cpython/Lib/idlelib/colorizer.py
resources/test/cpython/Lib/idlelib/idle_test/mock_tk.py
resources/test/cpython/Lib/idlelib/pyparse.py
resources/test/cpython/Lib/idlelib/replace.py
resources/test/cpython/Lib/idlelib/run.py
resources/test/cpython/Lib/importlib/_bootstrap.py
resources/test/cpython/Lib/lib2to3/tests/data/py3_test_grammar.py
resources/test/cpython/Lib/linecache.py
resources/test/cpython/Lib/logging/__init__.py
resources/test/cpython/Lib/test/coding20731.py
resources/test/cpython/Lib/test/test_asyncio/test_locks.py
resources/test/cpython/Lib/test/test_asyncio/test_pep492.py
resources/test/cpython/Lib/test/test_asyncio/test_server.py
resources/test/cpython/Lib/test/test_contextlib_async.py
resources/test/cpython/Lib/test/test_coroutines.py
resources/test/cpython/Lib/test/test_dis.py
resources/test/cpython/Lib/test/test_format.py
resources/test/cpython/Lib/test/test_pkgutil.py
resources/test/cpython/Lib/test/test_sys_settrace.py
resources/test/cpython/Lib/test/test_types.py
resources/test/cpython/Lib/test/test_typing.py
resources/test/cpython/Lib/unittest/test/testmock/testasync.py
resources/test/cpython/Lib/zoneinfo/_zoneinfo.py
resources/test/cpython/Tools/c-analyzer/c_parser/preprocessor/__init__.py
resources/test/cpython/Tools/scripts/stable_abi.py
resources/test/cpython/Tools/unicode/makeunicodedata.py

@Seamooo - Do you have any thoughts on or interest in working on this too?

Definitely have some interest in this area. A couple of comments as I've been going down various rabbit holes of python parser implementations:

The parser should be built from the CPython PEG, directly transpiled into either an equivalent grammar or used via proc_macro to generate the parser

Run into a lot of grammar specifications with weird FIXMEs about multiple edge cases because their grammar attempted to be a superset of CPython's, that didn't quite reduce down to the same grammar.

proc_macro gives the ability to generate a perfect hash function for a set of keywords at compile time
rust-peg seems to be an excellent compromise between exploiting the lower-bound time complexity for Packrat parsers without explicitly requiring caching every match, allowing multiple matches rather than lookups for manual performance tuning
rust-peg also has the necessary extensions to the formalised PEG grammar such that implementing the python grammar is possible

Ideally when https://github.com/charliermarsh/ruff/pull/742 becomes mergeable, implementing those traits for the IR output by the parser would make it immediately useable.

Yeah rust-peg does look good, and I believe that's what LibCST uses. My only hesitation there is that the LibCST parser is really slow compared to the RustPython parser? But I don't know how much, if any, of that is due to rust-peg. This is just based on the fixtures in the LibCST codebase:
rust_python_parse/all   time:   [289.30 µs 289.96 µs 290.64 µs]
                        change: [-4.8537% -4.5331% -4.2286%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 23 outliers among 100 measurements (23.00%)
  11 (11.00%) low mild
  2 (2.00%) high mild
  10 (10.00%) high severe

parse/all               time:   [1.7676 ms 1.7953 ms 1.8408 ms]
                        change: [-7.9448% -7.2284% -6.1601%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
  7 (7.00%) high mild
  3 (3.00%) high severe

parse_into_cst/all      time:   [2.2262 ms 2.2477 ms 2.2723 ms]
                        change: [-2.7483% -0.8482% +0.8620%] (p = 0.40 > 0.05)
                        No change in performance detected.
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe

(rust_python_parse/all is the RustPython parser, parse/all is the LibCST parser without inflation, and parse_into_cst/all is the LibCST parser with inflation.)

(And agreed on #742.)

I'm going to start playing around with a straight port of pegen to Rust. (Or, more specifically, modifying pegen to output a Rust target, which IIUC will also require rewriting the Python code from data/python.gram in Rust.)

Thanks for bringing this up @isidentical.
I have indeed written a Python parser in Rust. But I do not feel comfortable sharing it yet. While it's faster than any other Python parser I have seen, it's a bit rough around error recovery and few other things, but generally parses all valid Python programs (AFAIK). So if I ever release it, I'm happy to let you guys know.

Thanks @davidhalter! Super cool. Would love to see it if you ever release it.
If you don't mind sharing: did you write it from scratch? Or is it built atop a parser generator?

(I started on this in earnest tonight, I don't know if it will prove to be the right approach but the lower bound is that I learn a lot.)

@charliermarsh Yes I wrote it from scratch, it is a kind of weird mixture of LL and PEG, it's also a parser generator. I essentially pass it a slightly modified version of the official EBNF grammar.
I personally love writing parser generators, so when the opportunity presented itself, I took it :)

@Seamooo - Do you have any interest in collaborating w/ me on the Rust port of pegen? It's a private repo right now but would be happy to add you and talk about how I'm iterating on it.

Definitely would be interested

@Seamooo - Added you, repo is rough but your help is very welcome!

I'd love (read) access as well, if possible. I don't think I'm much help in contributing, but I've been looking at rust-peg to generate a Python-compatible ast. My rust knowledge isn't there yet though, so I'm finding it a bit hard to get going (I have a working POC with a few manually defined nodes, but I don't think that'll tell us anything useful about the performance hit).

@ljodal - Added! Would love to have any help / feedback.
(Anyone is welcome to be added, I'm just avoiding making it totally public while it's still in such an incomplete state.)

Anyone is welcome to be added

I'd like to take you up on that invitation if the attempt is still ongoing :-). We've recently been thinking of doing the same with RustPython's parser, porting pegen would just reduce the differences between grammar files between it and CPython, making syncing with it much easier. Not sure how much time I have lying around but I'd help as I could.

Rust port of pegen

I was thinking of adding a rust_generator.py file to CPython's copy of pegen, but I didn't quite know where to begin.

@fanninpm - I added you to my [rust-pegen] project. Feel free to collaborate there or use it as knowledge / inspiration or whatever is most useful. It adds a rust_generator.py to Pegen.

There's also a PEG grammar (https://github.com/charliermarsh/rust-pegen/blob/main/pegen/data/rust.gram) (has to differ from the Python grammar because the PEG grammars include actual code). The generated code is here.

As an update: my current hope here is to continue to use RustPython, especially since there's been a lot of good progress in the parser recently, although structural pattern matching in some form is still the biggest hurdle.

What would be the downside to using the CPython AST parser directly, since that is guaranteed to always be up-to-date?

The big one I think is that CPython’s AST doesn’t seem to have all the formatting information (whitespace, comments) stored. That’s why LibCST exists (which is written in Rust, but as said above, seems to be slow). I’m pretty sure Ruff needs this information to operate on comments and to do autofixes without mangling comments and whitespace.
If a well maintained, fast CST library written in C existed, and we rephrased the question to “why not use that C library”, I think there would be two ways to do it, each with their downside:

When directly using its data structures, it would be difficult to safely manipulate on the CST (necessary for auto fixes).
When converting its data structures to Rust, there’s Rust code to maintain again (not a big problem, the data structures shouldn’t change too much), and there’s a performance hit (probably not too big either)

Interestingly, RustPython's AST doesn't include any CST-like information -- it's very similar to the CPython AST. We get comments and other non-AST tokens from the token stream directly (comments are included in the token stream, but not in the AST).

So, as far as I understand, there are several things here. Ruff needs a CST representation of Python.
CPython doesn't have one. RustPython doesn't have one either.
The existing solution is LibCST which is slow. Could the reason for its slowness be the fact that it does more work?
My understanding is that a CST contains more information than an AST.
So, I see a new question:
Which solution is more appropriate:

the current one that uses an AST parser and takes non-AST tokens from the stream OR
a proper CST parser?

We've continued to improve the RustPython parser and it's working well for us! Some of these questions are coming up again with the autoformatter, where I have to map the AST to a CST by enriching it with information derived from the token stream.
In that context, I'm mostly focused right now on the CST representation itself and not the process by which it's parsed / extracted, which I'm punting until later.

I'm going to close this for now, as we're continuing to use and contribute to the RustPython parser. Nothing actionable here.


tiny switch on travis to switch over to containers

travis nags so this will resolve it : )
http://docs.travis-ci.com/user/workers/container-based-infrastructure/

Thanks for stubbing time the correct way. I hadn't done that in Python yet.


Broken links on GitHub pages version of 1.0 Overview

@peterbrightwell: these are broken links when converted onto GH pages:
NMOS Technical Overview 404
APIs Directory

Fixed by 8c602506c40f95fadce3676d10ee929e87fd429e


issue with crossmapnormalization layer

Hi Brandon,
If i dont use fbnn, i get the following error
Error getting result from Torch subprocess.
Line read:
Exception:
could not convert string to float:
stdout:
stderr: /home/akanksha/torch/install/bin/luajit: /home/akanksha/torch/install/share/lua/5.1/torch/File.lua:334: unknown Torch class
stack traceback:
[C]: in function 'error'
/home/akanksha/torch/install/share/lua/5.1/torch/File.lua:334: in function 'readObject'
/home/akanksha/torch/install/share/lua/5.1/torch/File.lua:360: in function 'readObject'
/home/akanksha/torch/install/share/lua/5.1/torch/File.lua:360: in function 'readObject'
/home/akanksha/torch/install/share/lua/5.1/nn/Module.lua:154: in function 'read'
/home/akanksha/torch/install/share/lua/5.1/torch/File.lua:342: in function 'readObject'
/home/akanksha/torch/install/share/lua/5.1/torch/File.lua:391: in function 'load'
...torch/demos/openface-master/openface/openface_server.lua:46: in main chunk
[C]: in function 'dofile'
...ksha/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670
Should i rectify it at the training level?? Since it seems that it uses fbnn crossmapnormaliztion during training ?

Duplicate of #101


Pluck doesn't support dynamic table name

GORM Playground Link
https://github.com/go-gorm/playground/pull/381
Description
https://github.com/go-gorm/gorm/blob/5202529ea147916a5b6e331c5d39f60859df2360/finisher_api.go#L486-L488
This condition will make an error that will ignore the scopes for the dynamic table name
check table name after scopes executed

@longlihale  Before upgrade gorm, we followed the docs using Scope to set the dynamic table name, after upgrading it's broken

@MittWillson  Hello, can give me a demo to see?

@longlihale https://github.com/go-gorm/playground/pull/381 this may be working on gorm v1.20.9

@MittWillson  Already fixed.


[pick][Enhancement](jdbc catalog) Add security check on driver when creating Jdbc Catalog

Proposed changes
Issue Number: close #xxx
pick master  (#31153)
Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall


Read ORCA Handbook and Policies

Read the Following Documents:

How_ORCA_Works.md
ORCA_Handbook.md
IT_and_Data_Security_Policies.md
Intellectual_Property_Policy.md
CODE_OF_CONDUCT.md
Add a comment to this issue with your initials and date completed, then close the issue

FDG 05/13/2024


cleanup files after uninstall

clean /var/lib/iml* on uninstall as store not getting truncated up now when agent stops/starts

This change is

Can one of the admins verify this patch?

Can one of the admins verify this patch?

this will probably be unnecessary as the store probably going to go away due to the work in https://github.com/intel-hpdd/intel-manager-for-lustre/issues/440


improve task reconnection

onDisposed was using the wrong task key
onDisposed wasn't getting added to the 2nd terminal for a task with a dependency
moved where setPersistentTask happens which allowed me to remove the conditional about type: $custom. before, was set in run and now waits for the task's start event to be fired
now throw an error in the place where this was happening to prevent future regressions
fix #158287

cc @alexr00 as you were asking why that conditional was needed 👍🏼


Exception when negating a fiber

Hi @willow-ahrens,
While running different configurations of levels I noticed that for negation I get an exception. Here's a code where I could reproduce it:
using Finch

A = [0.0 0.0 4.4; 1.1 0.0 0.0; 2.2 0.0 5.5; 3.3 0.0 0.0]
A_fbr = Tensor(Dense(Dense(Element(0.0))), A)

-A  # works
-A_fbr # fails

ERROR: Finch.FinchProtocolError("Cannot initialize Element Levels to non-default values (have literal(0.0) expected -0.0)")

Is negation for sparse fibers done differently or is it a bug?

Oh, interesting. Here's my question: Should the fill value of -A be 0.0 or -0.0?

because
julia> A = [0.0 0.0 4.4; 1.1 0.0 0.0; 2.2 0.0 5.5; 3.3 0.0 0.0]
4×3 Matrix{Float64}:
 0.0  0.0  4.4
 1.1  0.0  0.0
 2.2  0.0  5.5
 3.3  0.0  0.0

julia> -A
4×3 Matrix{Float64}:
 -0.0  -0.0  -4.4
 -1.1  -0.0  -0.0
 -2.2  -0.0  -5.5
 -3.3  -0.0  -0.0

Somehow, it looks like the fill value isn't getting set correctly.

Sure! It isn't a blocker for me, just wanted to share.

Thanks for filing the issue! I'll double check that it's fixed once I'm done.

Mateusz, I think the approach to try to fix this is to remove https://github.com/willow-ahrens/Finch.jl/blob/e6544d80f3da3973614634236cede0c360b0b493/src/symbolic/simplify_program.jl#L73C1-L73C50 and see if anything breaks terribly.


Support for recursive Source excludes

Currently Source excludes are implemented with using glob patterns.
Examples

ios/*.swift: all files with full path that ends with .swift
ios/configs: all files and directories under ios/configs
README.md: the README.md file in the root directory of your repository (doesn’t match ios/README.md)
ios/*.[mh]: files with the extension .m or .h only under the ios directory (but not its subdirectories)
configs/server[0-2].json: the files server0.json, server1.json, server2.json in the directory configs/

Aim is to add a more robust excludes support using **.
Examples

ios/**: all files with full path that starts with ios/ (i.e. any files in the ios directory)
**/README.md: the README.md file in all directories (including README.md in root directory of your repository)
ios/**/*.[mh]: all files with the extension .m or .h, in the ios directory and all of its subdirectories

Examples Disclaimer

Are there any plans for supporting the ** rule?


Distinguish between empty trees and non-existent sub-trees

Change S.find_tree to return an optional value. This allows to not conflate
the meaning of `Empty: it is now only "an empty subtree". And we use None to
denote non-existent sub-trees.

/cc @talex5

Why is Empty not just Node Node.empty?

Because this you can create a tree (starting from an empty tree) without having to tie it to a store.

(e.g. Node.empty is the hash of the empty tree, so need to be stored in the store first)

Where is this? ir_node.ml defines:
let empty = of_list []

Seems like any other implementation of NODE must define an empty too. Maybe internally they distinguish between a hash and empty, but why expose it in the tree type?

I've pushed a commit to remove Empty, it's a bit more complex that I would like as it forces Tree.empty to become a function: it's because the all node values have an associated (lazy) hash, and this could be cached if you save the empty value once, delete your DB on disk and use the empty value again. Then you will have a "not found" when trying to look for that hash.
I think ideally we would cache the empty value in the Repo.t value, but currently it is a bit hard to do.

Ah, because when you save a tree the empty node changes from a map to a hash?
But couldn't export_map always export the empty map as P.Node.Val.empty to avoid that?

Reverted and fixed in https://github.com/mirage/irmin/pull/435


TICK script - how to find elapsed time between two measurement points

I'm having difficulties to create a TICK script, that can find elapsed time between two measurement points. My Influx Measurement contains state points with values "on" and "off" (always in this order). I'd like to trigger event once "off" state arrives and calculates elapsed time between "on" and "off" state.

@vlasov01 There is no clean way to do this within Kapacitor at the moment.
One way I can think to do this is to use the derivative method, its really hacky but if on had a value of 0 and off had a value of 1 then then the derivative was computed it would do:
 (1 - 0 / elapsed) and then you could use an eval node to invert the result and get elapsed back out.
Since the above method is really confusing and fragile we should probably add a method for computing elapsed times. Maybe something as simple as:
stream
     .from()....
     .elapsed()
          .as('elapsed')
     .alert()
         .crit(lambda: "status" == 'off')
         .message('Elapsed time: {{ index .Fields "elapsed" }}')

Would that fit your needs?
Can you provide more context about what you are trying to do with the elapsed time as this seems like an interesting use case?

@nathanielc Thank you for the prompt reply!
I'm using Kapacitor v0.11. I've implemented script based on your code sample.
var online = stream
    .from().measurement('watersensor')
    //.where(lambda: "last" == 'offline')
    .elapsed()
         .as('elapsed')
    .alert()
         .info(lambda: "state" == 'offline')
         .message('Elapsed time: {{ index .Fields "elapsed" }}')
         .log('/var/log/kapacitor/summary.log')

But getting the following error when trying to define script:
invalid task: No method or property "elapsed" on
A bit about my use case:
The water sensor controller is switches into an "online" state when water is switched on and switches to an "offline" state once water flow stops. I'd like to measure the elapsed time of water flow. These points are accumulated in the "watersensor" measurement.
At the same time, controller is publishing every 5 seconds amount of water used. These points are accumulated in the "water" measurement.
Once water flow stops ("watersensor" state=="offline") I'd like to calculate summary of water used and how much time it was on and publish info/warn/crit alert,

@nathanielc It seems the proposal #388 looks a bit similar.
But now I'm thinking may be it makes more sense to implement it directly as a continuous query as per https://docs.influxdata.com/influxdb/v0.11/query_language/continuous_queries/ ?


Adds Flexible Labeling

Closes #10
There is also an tutorial on how to use the feature! The tutorial will start working when this PR gets merged and pushed to vfarcic/docker-flow-monitor.
I added a small change to testing: go test --cover ./... --run UnitTest -p 1 because the mocking of cmdRun seems to sometimes fail with multiple processes.

Can you write a few sentences that I could use for the release description?

Adds flexible labeling of exporters to DFM. Please consult the Flexible Labeling with Docker Flow Monitor tutorial to learn more.


node:xxx CORS error

With islands component like following, I got CORS error.
Why Deno or fresh accesses to node:xxx, such as node:prcess, node:url, node:tls, etc.
And, how to fix this error.
export default function Sidebar() {
	useEffect(() => {
		(async () => {
			try {
	 			const client = new MyClient();
                                 ...
			} catch (err) {
				console.error(err);
			}
		})()
	}, [])

// Just set url in constructor
export class MyClient {
  apiBaseUrl: string;

  constructor() {
    this.apiBaseUrl = config.BACKEND_ENDPOINT; // http://localhost:8080
  }
}

fresh: v1.6.1

Sounds like you're pulling in code into your islands which is not meant to run in the browser, but rather on the server. We can't help you more based on the snippet you provided because the culprit is likely the various imports in that island files. Or the files that are imported in the island import another file that in turn pulls in server-only dependencies.

I found server-only dependencies from imported file. And, when remove the code, the code works fine. Thanks.


nginx: add http.sock mapping to enable customize web server for each user

ref: https://is.gd/YEXT7X
This patch only contains changes for <user>.<server>.hashbang.sh -> http.sock mapping,
The hashbang.sh/~<user> -> ~user/Public was removed due to security reasons.
The https changes will be posted in a separated patch after we finalize the nginx build we use.

is there a reason port 443 is not enabled?

To quote @lrvick:

add nginx repo and key, pin 1.10

As well as the above requested changes and allowing passthrough of raw TCP, that needs to be done as well.
References:

http://nginx.org/packages/debian/
http://stackoverflow.com/questions/34741571/nginx-tcp-forwarding-based-on-hostname

@RyanSquared No, nginx.org has a too-old version.
In any case, OK for me to go forward with HTTP-only and switch to a newer Nginx later on.

The hashbang.sh/~ -> ~user/Public was removed due to security reasons.

What were these security reasons?

@daurnimator - race conditions with symlinks: there's no way to ensure that a file hasn't changed since you've checked the permissions, and made sure it's safe to load, before loading it.

@daurnimator - race conditions with symlinks: there's no way to ensure that a file hasn't changed since you've checked the permissions, and made sure it's safe to load, before loading it.

huh? which symlink? why are we checking permissions?
(Shouldn't we just be attempting to serve ~/Public. and if it is accessible by the 'www' user then it will work)

@daurnimator Imagine you just blindly serve the contents of ~/Public.
What prevents me from putting under my ~/Public a symlink to /some/readable/file/like/private.key ?

Also, it forces user to set mode 0711 (at least) on their homedir, which can be nasty.

Lastly, it forces us to do annoying cert handling server-wide or have a wildcard for *.hashbang.sh if we ever want to provide TLS for ~/Public that way.

What prevents me from putting under my ~/Public a symlink to /some/readable/file/like/private.key ?

If a file anywhere on the system is accessible by the user/group "www" then you should assume it's accessible to the web. Is private.key readable by the www user?

Also, it forces user to set mode 0711 (at least) on their homedir, which can be nasty.

Howso? And don't we already do this? I remember setting it up before.

Lastly, it forces us to do annoying cert handling server-wide or have a wildcard for *.hashbang.sh if we ever want to provide TLS for ~/Public that way.

I thought ~/Public was going to be served from <host>.hashbang.sh/~user

If a file anywhere on the system is accessible by the user/group "www" then you should assume it's accessible to the web. Is private.key readable by the www user?

Shouldn't it be? The www user needs to be able to load it, no?

Howso? And don't we already do this? I remember setting it up before.
:+1:, still not sure why this is required.

I thought ~/Public was going to be served from .hashbang.sh/~user

That is correct.

@daurnimator - found this: https://unix.stackexchange.com/a/13891

Shouldn't it be? The www user needs to be able to load it, no?

I thought it would load the private key before changing to the www user. But now I'm not so sure.

@daurnimator You can read memory or file descriptors from /proc too, it's kinda tricky.

@daurnimator You can read memory or file descriptors from /proc too, it's kinda tricky.

Ah I didn't think of that. Sounds tricky indeed.

What about https://nginx.org/en/docs/http/ngx_http_core_module.html#disable_symlinks ?

@KellerFuchs thoughts around that disable_symlinks option?

@daurnimator It's unclear whether it avoids the classic fstatat/open race condition...

Presumably you wouldn't need fstatat() for this; you could just use open(<path>, O_NOFOLLOW). If nginx doesn't do this, then it's a bug with nginx and should be fixed.

@RyanSquared O_NOFOLLOW only prevents the last component of the path from being a symlink.
i.e., if /home/kellerfuchs/foo is a symlink to /proc, I can totally make it open /home/kellerfuchs/foo/self/mem and other exciting things.

Oh. :(

So, what about we have the sock files at single dir and let nginx chroot to that dir?

@daurnimator It's unclear whether it avoids the classic fstatat/open race condition...

See http://hg.nginx.org/nginx/file/4a670c18e5e6/src/core/ngx_open_file_cache.c#l500

@daurnimator This looks safe enough.


Check resume one more time

Check resume for typos or any mistakes

Make sure all contact links are correct


Cargo workspace - Control what is included in vercel build

My workspace consists of some crates which need to be uploaded to vercel, and some crates which do not. For example:
my_workspace/
    api/
    cli/
    models/

If I run vercel deploy from the workspace root, the deploy succeeds, all crates are uploaded, the build runs fine and the serverless function can be executed successfully.
However in this case, only api and models need to be uploaded to vercel, api is what's served and it depends on the models crate. cli is standalone and does not need to be included in the build.
I can add the cli project to .vercelignore and it's excluded from the uploaded, however the build fails because my workspace Cargo.toml still has the cli crate listed as a member.
Is there any way I can control what is included in the build that vercel executes? I'd like to prevent uploading and building assets which are not required by the api crate mostly to reduce the build time.

It seems to work if I build first then deploy, e.g, with the project setup above. With that being the case, I can hopefully just setup a github action (thanks for this) and run through the build and deploy steps.
I'll leave this open until I confirm this works as expected.

I'll close this as I seem to have something that works for me.
I'm not completely sure of the setup, but I think the key is having my "private" crates (those which I dont want to upload to vercel) listed in .vercelignore, then just run vc build --prod and vc deploy --prod --prebuilt


Provide docker image variant based on distroless

with naming :
metacontrollerio/metacontroller:v4.0.1-distroless
so by default point to alpine, but if user want - it can use distroless one.

need to setup another dockerfile and attach it to pipeline run

https://github.com/metacontroller/metacontroller/pull/150

https://github.com/metacontroller/metacontroller/pull/150


copilot cuts off response

VS Code Version: v1.138.0
OS Version: Mac
Logs:

Steps to Reproduce:
Whenever I ask it a question it cuts off the response and since it doesn't close the markdown file the code is cut off and appears as raw text.
I apologize for the previous incomplete responses. Here's the complete code snippet:
Example Response:

async def main(): async with aiohttp.ClientSession() as session: url = "[https://api.runpod.ai/v2/4cdjr4l2q2vgwo/run"](vscode-file://vscode-app/private/var/folders/h5/7ytbnyrd6td6rkp3kb786l4c0000gn/T/AppTranslocation/B89A04A4-4D88-4FA2-B471-9F5E9FD2F872/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html) headers = {"Content-Type": "application/json"} data = { "input": { "system_prompt": "You are girlfriend.", "user_prompt": "hey babe how are you?", "sampling_params": { "max_tokens": 500, "stop": ["\n", "

1. ask it to provide code
2.

@cdubiel do you see an error message overlayed on the response, or does it just stop at an odd moment?

it stops at an odd moment

it's been doing that to all my answers randomly which is a big hinderence

I found one workaround, you follow up with a new message that says   "continue the answer from [Copilot Answer] just make sure you C&P the last section you see and copilot will continue with the answer. Its still very annoying, but at least it works.

@cdubiel the issue is that your response is generating an LLM stop word. We'll look into it.

I ask for all my answers to be place into Markdown. What I see is that code blocks are not terminated where the code block ends...but goes past the final text and then places the three ```. Here is a screen shot

@CheetahChrome what version of the extension are you using?

version of the extension are you using?

Github Copilot 1.141
Copilot Chat: 0.11


Adding brew install pkg-config for MacOS

Summary
When executing spack install for spack-stack 1.4.1 on MacOS, the configuration step of building libevent 2.1.12 reports
configure: error: openssl is a must but can not be found. You should add the directory containing openssl.pc to the PKG_CONFIG_PATH environment variable, or set CFLAGS and LDFLAGS directly for openssl, or use --disable-openssl to disable support for openssl encryption
After a Google Search, it was determined that the command brew install pkg-config must be executed in order for openssl to be resolved locally.
See https://github.com/libevent/libevent/issues/1136.
checking for openssl/ssl.h... no
configure: error: openssl is a must but can not be found. You should add the directory containing `openssl.pc' to the `PKG_CONFIG_PATH' environment variable, or set `CFLAGS' and `LDFLAGS' directly for openssl, or use `--disable-openssl' to disable support for openssl encryption
==> Error: ProcessError: Command exited with status 1:
    '/Users/eric2/jedi/spack-stack-1.4.0/cache/build_stage/spack-stage-libevent-2.1.12-twy4bcexa6xhzcnrobdeqbfpn3asyenz/spack-src/configure' '--prefix=/Users/eric2/jedi/spack-stack-1.4.0/envs/skylab-5.0.0/install/apple-clang/14.0.3/libevent-2.1.12-twy4bce' '--enable-openssl'

1 error found in build log:
     114    checking for pkg-config... no
     115    checking for library containing SSL_new... no
     116    checking for library containing SSL_new... no
     117    checking openssl/ssl.h usability... no
     118    checking openssl/ssl.h presence... no
     119    checking for openssl/ssl.h... no
  >> 120    configure: error: openssl is a must but can not be found. You should add the directory containing `openssl.pc' to the `PKG_CONFIG_PAT
            H' environment variable, or set `CFLAGS' and `LDFLAGS' directly for openssl, or use `--disable-openssl' to disable support for openss
            l encryption

See build log for details:
  /Users/eric2/jedi/spack-stack-1.4.0/cache/build_stage/spack-stage-libevent-2.1.12-twy4bcexa6xhzcnrobdeqbfpn3asyenz/spack-build-out.txt

...

==> Error: Terminating after first install failure: ProcessError: Command exited with status 1:
    '/Users/eric2/jedi/spack-stack-1.4.0/cache/build_stage/spack-stage-libevent-2.1.12-twy4bcexa6xhzcnrobdeqbfpn3asyenz/spack-src/configure' '--prefix=/Users/eric2/jedi/spack-stack-1.4.0/envs/skylab-5.0.0/install/apple-clang/14.0.3/libevent-2.1.12-twy4bce' '--enable-openssl'

Testing
This has been tested on MacOS 13.4.1.
Applications affected
All end result JEDI executables.
Systems affected
MacOS
Checklist

[x] This PR addresses one issue/problem/enhancement, or has a very good reason for not doing so.
[x] These changes have been tested on the affected systems and applications.
[x] All dependency PRs/issues have been resolved and this PR can be merged.

@ericlingerfelt I think I have an idea of what is happening. I was wrong in thinking that libevent and pkg-config are unrelated. I did some research into pkg-config and this is a tool that helps set up command line options for compile steps in build processes. pkg-config is not listed as a dependency of libevent in the spack formula, but I suspect that it is being used to do the compile steps. If this is true, then it does make sense that installing pkg-config with homebrew is fixing the issue with your build.
If this is correct, I think the proper way to fix this is to add pkg-config as a dependency for libevent in the spack formula and add the proper variants/version/etc for pkg-config. In other words I think installing pkg-config with homebrew is a temporary solution.
I think we need to document the need (for now) to install pkg-config with homebrew, but I'm a little bit concerned (without knowing the true root cause of your build issue) if that is the proper way to handle this in the long term. Especially when it seems that many Mac users don't need to homebrew install pkg-config to get spack stack to build.
For this PR, it might be better to write a note after the list of packages to be installed with homebrew to let the user know that they can try installing pkg-config with homebrew if their libevent build does not succeed. Ie, treat it more like a workaround instead of a hard requirement (at this point). Would this be agreeable?

Hi @srherbener, I completely agree with your approach to issue. Thanks!

Closing as taken care of in https://github.com/JCSDA/spack-stack/pull/726.


x/tools/gopls: add tests for finding references in replace targets

We don't have any tests for this behavior.

We still don't have any tests for this, but it's hard to imagine* references (and related features) × replace not working correctly, since architecturally they are so orthogonal.
*Clearly all these years of writing buggy code have not enlarged my imagination...


Unable to create a subscription

I've initiated Razorpay with my TEST key and secret.
Below is the code and error -
razorpay.subscriptions.create({
    "plan_id": PRO_PLAN_ID,
    "customer_notify": 1,
    "total_count": 1,
    "start_at": Date.now()
})
.then(subscription => {
    if (subscription) {
        return res.render('purchase', {subscription: subscription })
    } else {
        throw new Error('Invalid subscriptions')
    }
})
.catch(err => {
    return next(err)
})

Error
(node:10194) Warning: a promise was rejected with a non-error: [object Object]
// when i log the error -
{ statusCode: undefined, error: undefined }

My plan_id is valid and my subscriptions is enabled with Razorpay.
Absolutely unable to move forward. Can someone help? @rzpamidi ?

@ktkaushik  , which version of the package are you using ?

@rzpamidi I've 2.0.1

@ktkaushik  , i am not able to reproduce this normally, but this happens when there i am disconnected from the internet
One thing wrong in your code is that , you need to pass epoch seconds , where as you are passing milli seconds using Date.now() , try Date.now()/1000 | 0

@rzpamidi I am not disconnected from the internet but trying this out on localhost, that shouldn't be a problem right?
Also, i tried passing epoch seconds, that didn't change anything.
Is there a more stable version that you would recommend me using which has subscriptions feature?

@ktkaushik  , Please let me know what do you see when you do curl https://api.razorpay.com in bash

@rzpamidi
curl https://api.razorpay.com
{"message":"Welcome to Razorpay API."}

@rzpamidi curl works fine -
curl -X POST \
  -u "<ID>:<SECRET>" \
  --data "plan_id=<PLAN_ID>" \
  --data "total_count=1" \
  https://api.razorpay.com/v1/subscriptions

This is the complete code.
let express = require('express');
let router    = express.Router();
let secret    = require('../config/secret');

const Razorpay         = require('razorpay')
const PRO_PLAN_ID = 'MY_PLAN_ID_HERE';

let razorpay = new Razorpay({
    key_id: secret.razorpay.keyId,
    key_secret: secret.razorpay.keySecret
})

router.get('/buy', (req, res, next) => {
    razorpay.subscriptions.create({
        "plan_id": PRO_PLAN_ID,
        "customer_notify": 1,
        "total_count": 1,
        "start_at": Date.now()/1000 | 0
    })
    .then(subscription => {
        if (subscription) {
            return res.render('purchase', { subscription: subscription })
        } else {
            throw new Error('Invalid subscriptions')
        }
    })
    .catch(err => {
        return next(err)
    })
})

module.exports = router;

@ktkaushik  Can you please put console.log(err) below line 10 in your node_modules/razorpay-node/dist/api.js ? and let me know what you see ?

@ktkaushik  , Please let us know the node and npm version that you are using

Node version is v9.11.1 and npm is 5.6.0

@ktkaushik  , Please drop us a mail on<EMAIL_ADDRESS>regarding this issue , will take this from there

@rzpamidi Cool. I will do that.

Done.

Closing this issue as there seems to be an issue related to the environment in which the script is running


Swedish translation

Swedish translation.
The json file is created with ISO 639-1 in mind.
/Synt3x

Thank you!


Create async-wait

Key Benefits and Use Cases:
Readability: async/await greatly improves code readability by making asynchronous code look similar to synchronous code. This leads to cleaner and more maintainable code.
Error Handling: Error handling becomes straightforward with try...catch blocks when using await. Errors are caught at the point where they occur, making debugging easier.
Simplified Control Flow: await allows you to write asynchronous code sequentially, even when dealing with multiple asynchronous operations, avoiding callback hell or deeply nested callbacks.
Promise-Based: async/await is built on top of promises, which are a fundamental asynchronous programming concept in JavaScript. It simplifies working with promises.
Non-Blocking: While waiting for an await operation to complete, JavaScript can continue executing other code, making applications responsive.
Common Use Cases: async/await is commonly used for tasks like fetching data from APIs, reading/writing files, database queries, and any other operation that involves waiting for a result.

Concept of Async and Wait