Use import() on esm files in supported node versions

This is a proof-of-concept of using import() to load ESM files in supported node versions (>= 14, >= 13.2.0, >= 12.17.0). The syntax breaking import() call is located in a separate file from bin/tape.js that is conditionally loaded, preventing older Node versions from crashing.
This is currently an unfinished draft. I'm mainly curious to see if you are interested in something like this.
Currently this branch does not use promises to sequentially load the imported files. I have a separate branch, https://github.com/lohfu/tape/blob/esm-support-promises/bin/load-module-esm-support.js#L27-L29, where I have implemented sequential loading but this causes a test repo with a couple of simple test files to fail.
Questions / Caveats

What is needed for the sequential loading to work? It seems like tape finishes before all tests are run properly. In a very simple repo with 2 test files all tests in the second file error with not ok 2 test exited without ending: file 2 test 1. The tests simply contain a single t.pass and a t.end. All tests in the tape repo pass.
Currently only ${cwd}/package.json is loaded as I was a little reluctant to add a new dependency to find closest package.json... Is this ok? Do you have any preferences?
Is there a better way to determine ESM support than checking the node version?
nyc instrumentation fails: failed to instrument /home/lohfu/dev/tape/bin/load-module-esm-support.js with error: SyntaxError: 'import' and 'export' may only appear at the top level (14:8)... Can I update tap to get a newer nyc?
Currently only .mjs and .js files are loaded using import(). This prevents the use of loaders on other file extensions. In the future an --extension argument will probably be needed in the cli to allow for loaders on custom extensions.
Is the bin file ever bundled into browsers? I presume bundlers will add the file with the import to the bundle, which will cause older browsers to SyntaxError.

Codecov Report

Merging #547 (25a5f1a) into master (50751db) will decrease coverage by 0.88%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #547      +/-   ##
==========================================
- Coverage   74.65%   73.76%   -0.89%
==========================================
  Files          19       19
  Lines         789      789
  Branches      151      151
==========================================
- Hits          589      582       -7
- Misses        200      207       +7

Impacted Files
Coverage Δ

lib/test.js
94.30% <0.00%> (-1.43%)
:arrow_down:

index.js
96.73% <0.00%> (-1.09%)
:arrow_down:

lib/results.js
99.31% <0.00%> (-0.69%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50751db...25a5f1a. Read the comment docs.

We also can’t upgrade tap due to the node versions it drops.

the new tests i have added fail due to the problem i explained in the PR description, namely all tests in the files loaded after the first fail with not ok 2 test exited without ending: module-b

We also can’t upgrade tap due to the node versions it drops.

hmmm, ok. any other way of circumventing the instrumentation error?

I'm not sure what the instrumentation error is; is it about import()?

regarding the failing tests, if you point me in the general direction of possible causes i am keen to start debugging and looking for solutions.

I'm not sure what the instrumentation error is; is it about import()?

yes, the exact error is:
failed to instrument /home/lohfu/dev/tape/bin/load-module-esm-support.js with error: SyntaxError: 'import' and 'export' may only appear at the top level (16:8)

add bin/load-module-esm-support.js to exclude in .nycrc?

also we'll need to make sure the tests that do imports are skipped in the appropriate node versions.

@ljharb what do you think about using this solution instead of checking which version of node is used to figure out if dynamic import is supported?
https://github.com/davidtheclark/cosmiconfig/pull/251/files#diff-e61e569af4ed5c2bd19c648e11225dd502296f0931b339c88cb82288a493e6ad

@lohfu that's basically the solution i'll be using in the package i forgot to create :-) let me get on that today.

Codecov Report

Merging #547 (9096f1b) into master (75decb3) will decrease coverage by 0.31%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #547      +/-   ##
==========================================
- Coverage   96.70%   96.38%   -0.32%
==========================================
  Files           4        4
  Lines         607      609       +2
  Branches      144      145       +1
==========================================
  Hits          587      587
- Misses         20       22       +2

Impacted Files
Coverage Δ

lib/results.js
99.32% <100.00%> (-0.68%)
:arrow_down:

lib/test.js
95.67% <0.00%> (-0.29%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75decb3...9096f1b. Read the comment docs.

@lohfu alrighty, give https://npmjs.com/has-dynamic-import a spin

@lohfu alrighty, give https://npmjs.com/has-dynamic-import a spin

Sweet! Unfortunately I ran into some trouble with it immediately... I use has-dynamic-import to skip the ESM tests, and currently they arent skipped and fail in Node 10, 11, < 12.17 and < 13.2. All else seem to work fine. I created an issue and a PR explaining the issue and possible workaround.

i have fiddled around a little with getting this PR working with inspect-js/has-dynamic-import#3. all tests seem to be working on my end, but i have the following questions:

is the current way of handling async module loading ok? see:

https://github.com/substack/tape/pull/547/files#diff-cac4e8fa9811bc382c4e22b2d21dd2bf2b00675c458d17cbc221866db62f078eR55
https://github.com/substack/tape/pull/547/files#diff-75d9d2e71dcc077af46469ce4fce3f93e91f27b8f09b82dfa5574c304ee69aa3R86

should we have an option for custom extensions that enforces import() like .mjs does now? this would enable using loaders and other spooky magic (https://github.com/substack/tape/pull/547/files#diff-79dfc9fc6fa8fb5312506d39301093b519b95edbb72465a85102b1be7ec0f0f7R9)
should i squash/rebase away all "useless" commits or do you want the full history?

also, since full support check is now async and the tap skip option is sync, i used async sub-tests to exclude import() tests in unsupported environments (https://github.com/substack/tape/pull/547/files#diff-5ab063121df04838565bf235950a645d72c689af2409b48129368b6317bf23b2R8-R52)

When node supports something more, we can add support for it. At the moment, there are no other kinds of modules.

It occurred to me today that node only has --require and does not have any way to evaluate ESM files on process load - it might be better to wait until node has that support before adding it here, in case they conflict.

removed!

I'm not sure what you removed - what i mean is, --require=./foo.mjs is impossible in node, so i'm wondering if it should remain impossible in tape.

i removed the logic to use import() statements on ESM file in the --require option.
i am feeling pretty ready with this PR now... if you are ok with the wait()/run() logic for handling async importing of tests before running them i will update the README and squash everything to a single commit.

so i started using the changes in this branch on a project, and i've found a major drawback to the handling of rejections when loading test files.
https://github.com/substack/tape/blob/229bd7876ec71d5c8d7681a4f2e6c13cb61a0efe/bin/tape#L67-L73
catching errors in our loading promise, console.error:ing them and then exiting makes it very difficult to locate syntax errors in ESM files. running an ESM file with invalid syntax "natively" in Node prints:
$ node tmp.mjs
file:///home/lohfu/dev/tape/tmp.mjs:1
)
^

SyntaxError: Unexpected token ')'
    at Loader.moduleStrategy (node:internal/modules/esm/translators:147:18)
    at async link (node:internal/modules/esm/module_job:64:21)

the actual stack trace contains no information of where the syntax error is; it's the lines before that the discloses the error and its location. running the same file with this branch prints:
$ ./bin/tape tmp.mjs
SyntaxError: Unexpected token ')'
    at Loader.moduleStrategy (node:internal/modules/esm/translators:147:18)
    at async link (node:internal/modules/esm/module_job:64:21)

that information obviously makes it difficult to locate the problem without external tools. node appears to behave differently when the syntax errors are in commonjs files, ie when tape calls require() and not import(). in that case, console.error(err) prints the syntax error and it's location:
$ ./bin/tape tmp.cjs
/home/notme/dev/tape/tmp.cjs:1
)
^

SyntaxError: Unexpected token ')'
    at Object.compileFunction (node:vm:353:18)
    at wrapSafe (node:internal/modules/cjs/loader:1039:15)
    at Module._compile (node:internal/modules/cjs/loader:1073:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at module.exports (/home/notme/dev/tape/bin/import-or-require.js:12:5)
    at /home/notme/dev/tape/bin/tape:85:24

Yeah, i think node does some magic with exceptions that are not caught and re-thrown. I’m not sure how to solve for that.

After giving it some thought I have come up with some changes. The basic idea is to use process.nextTick to leave the promise chain after checking for dynamic import support and only enter into a new promise chain if we need to load ESM files. This way we avoid unhandled rejections when only loading commonjs files, ie in all current setups using tape. If we do enter into a promise chain when loading files, errors are no longer caught. This makes node 15 onward handle errors in the loading promise very similar to how they are handled in sync loading. I know one should usually strive for handling all rejections, but i reckon this is a bit of an edge case. We want the program to quit when there are errors importing files, and we want to show exactly what Node natively prints. If rejections need to be handled when importing files, shouldn't the current require calls be wrapped in a try/catch?
After these changes, this PR will only affect people that consciously try to load ESM files. It will only be awkward for people that are trying to use ESM files in Node versions before 15. People converting their projects to full ESM most likely use very modern versions and as such, this should affect few.
On errors importing files, the previous changes printed (console.error():ing rejections import())::
SyntaxError: Unexpected token ')'
    at Loader.moduleStrategy (internal/modules/esm/translators.js:84:18)
    at async link (internal/modules/esm/module_job.js:36:21)

For rejections require():ing files, the output is the same as requiring the files outside the promise.
With the changes from the latest commits, different Node versions will print something like:
Node >=15
file:///home/notme/dev/tape/tmp.mjs:1
)
^

SyntaxError: Unexpected token ')'
    at Loader.moduleStrategy (node:internal/modules/esm/translators:147:18)
    at async link (node:internal/modules/esm/module_job:48:21)

Node ^12.17, ^13.2 and 14 prints:
(node:91315) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token ')'
    at Loader.moduleStrategy (internal/modules/esm/translators.js:84:18)
    at async link (internal/modules/esm/module_job.js:36:21)
(node:91315) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:91315) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

All Node versions that do not support import:
/home/notme/dev/tape/tmp.mjs:1
)
^

SyntaxError: Unexpected token )
    at Module._compile (internal/modules/cjs/loader.js:760:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at /home/lohfu/dev/tape/bin/tape:86:34
    at Array.forEach (<anonymous>)
    at importFiles (/home/lohfu/dev/tape/bin/tape:86:11)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)

If rejections need to be handled when importing files, shouldn't the current require calls be wrapped in a try/catch?

It's not that they need to be handled; it's that module-level exceptions (at require/import time) should crash the process; unhandled rejections (including from an ESM module that does export function then() { throw 42 }) should not.
Ideally, a module-level exception from a CJS file should look the same in any version of node, whether or not you're including ESM files.
Your last comment implies we might be pretty close to the ideal scenario :-) I'll take a look!

Since playing around a little with the --unhandled-rejections=mode CLI option I am getting quite convinced this is a reasonable solution. Using the NODE_OPTIONS env variable to set unhandled rejections mode to either strict or throw, Node and tape handles unhandled rejections the same in all version of Node that supports ESM imports.
$ NODE_OPTIONS='--unhandled-rejections=throw' ./bin/tape tmp.mjs
file:///home/notme/dev/tape/tmp.mjs:1
)
^

SyntaxError: Unexpected token ')'
    at Loader.moduleStrategy (node:internal/modules/esm/translators:147:18)
    at async link (node:internal/modules/esm/module_job:48:21)

I added some tests to check how the process exits, but do not really have any tests checking the error output.

@ljharb have you had any time to review the latest changes?

@lohfu thanks for your patience and for working so thoroughly on this, I really appreciate it!
I'll cut a release that includes this soon.

See v5.3.0

Just here to say that this is amazing, thank you everyone 🥳


missing native mouse function for canvas

p5 thinks of the entire window as the sketch.
p5.mouseDragged = ( ) => { ... }
to inhibit this behavior, the developers of P5 allow you to directly use these functions on the canvas.
link from another issue from p5.js. Copying the suggested codeblock from original answer.
(https://github.com/processing/p5.js/issues/1437)
function setup() {
  var c = createCanvas(100, 100);
  c.mousePressed(doStuff);
}

function doStuff() {
  console.log('clicked on canvas');
}

I noticed this functionally does work on the p5-svelte for mousePressed, mouseReleased, mouseClicked except for mouseDragged.
here's my example block:
p5.setup = () => {
      let canvas = p5.createCanvas(width, height);
      canvas.mousePressed(() => {
        ...
      });
      // Here
      canvas.mouseDragged(() => {
        ...
      });

      canvas.mouseReleased(() => {
        ...
      });

      canvas.mouseClicked(() => {
        ...
      });
    };

I'm not sure if this was intended or if I'm not properly implementing this. If this isn't integrated, I'd like to request this functionality.

I'm having the same problem currently. I'm unable to call mouseClicked() on  a specific element.

Code like this will work. But it is not consistent with canvas API.
p5.mouseDragged(() => {
  ...
});

I'm fixed my case (move event tracked in main loop) by checking mouse buttons state explicitly:
const state = { hover: false, ...

setup() {
  ...
  canvas.mouseOver(() => (state.hover = true));
  canvas.mouseOut(() => (state.hover = false));
}

...
// check here
function isMouseInteraction(btn) {
  return state.hover && renderer.mouseIsPressed && renderer.mouseButton === btn;
}


fix: makes _buildClassTypeFromJson not typed

Serverpod should not be opinionated on the fromJson parameter type of custom classes.
This PR fix the issue https://github.com/serverpod/serverpod/issues/2715
Pre-launch Checklist

[x] I read the Contribute page and followed the process outlined there for submitting PRs.
[x] This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
[x] I read and followed the Dart Style Guide and formatted the code with dart format.
[x] I listed at least one issue that this PR fixes in the description above.
[x] I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
[x] I added new tests to check the change I am making.
[x] All existing and new tests are passing.
[x] Any breaking changes are documented below.

If you need help, consider asking for advice on the discussion board.
Breaking changes
No breaking changes

I have read the CLA Document and I hereby sign the CLA


Add EIP1559 support for eth_maxPriorityFeePerGas and eth_feeHistory

This PR adds support for eth_maxPriorityFeePerGas and eth_feeHistory which were added during the London fork for EIP1559 support.
Reference

Tests are also wrong on the eth_fee_history RPC call. Fixing now.

Tests are also wrong on the eth_fee_history RPC call. Fixing now.

Done

@akramhussein thank you for your contribution.
your changes were released in 0.10.0.
I skipped your tests for now. we need to improve our ci
I remember @rupurt was working on this in https://github.com/mana-ethereum/ethereumex/pull/106. so how it's going? 😄

Thanks!


Unable to publish artifact [Allure Report]: ........ /allure does not exist.

Below is my setup.

Everything works fine as long as tests pass.
When there is any failure, reports do get generated based on Bamboo logs but this plug-in doesn't generate report and hence /allure directory is not found as an Artifact.

@sahas- : This plugin only generates Allure report based on XML files generated by another Bamboo task (e.g. tests run by some language automation tool like Maven). I think the issue is that in case of failure the tool of your choice does not create respective XML file. Which test framework are you using?

@vania-pooh I'm using wdio which intern uses mocha. When I test this failure case locally, I do see "allure-results" gets gets populated with results. The same case with Bamboo as well. Does that help?

@sahas- as I see from your screenshot, you set Allure version to 1.3.9. Try to change it to latest 1.4.23. Wdio works fine only with latest 1.4.x Allure versions

Thanks, it works.
Plus, we need to add Allure part of  "Final tasks" so that it runs regardless of test success/failure.


release v0.31.4

Proposed changes
release v0.31.4

Types of changes

[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Refactor (changes to code, which do not change application behavior)

Checklist

[ ] I have filled out this PR template
[ ] I have read the CONTRIBUTING doc
[ ] I have added automated tests that prove my fix is effective or that my feature works
[ ] I have added necessary documentation (README.md, inline comments, etc.)
[x] I have updated the CHANGELOG.md under a ## next release, with a short summary of my changes

Relevant Links
Based on PR #369

Further comments

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Jaya Nanda seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


How to make autocomplete with FormlyBootstrap

Question
I want to use Bootstrap typeahead in formly.  I created a wrapper for typeahead and send my array to this wrapper but could not get the value of input because the only thing this wrapper does was show a list of array that I gave. I want to make a typeahead and want to get the value of that input.

have you checked the material autocomplete example https://formly.dev/ui/material, it should be done somehow using a similar approach

have you checked the material autocomplete example https://formly.dev/ui/material, it should be done somehow using a similar approach


Rebootstrap the VMR

Once https://github.com/dotnet/installer/pull/19612 is merged and a build has been completed with the changes, the VMR needs to be rebootstrapped in order to resolve https://github.com/dotnet/sdk/pull/40572#issuecomment-2085547093.
https://github.com/dotnet/installer/pull/19683 needs to be reverted after the rebootstrap as well.
Will close after we rebootstrap again and https://github.com/dotnet/installer/pull/19683 gets reverted (for sdk)

The build that I was going to pull the artifacts from failed building Roslyn in Stage 2:
##[error]/vmr/src/roslyn/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs(74,27): error CS0121: (NETCORE_ENGINEERING_TELEMETRY=Build) The call is ambiguous between the following methods or properties: 'string.Join(string?, ReadOnlySpan<object?>)' and 'string.Join(string?, ReadOnlySpan<string?>)'

If we rebootstrap, all the Stage 1 builds will fail with this same error.
cc @ViktorHofer @dotnet/source-build-internal

Let's try to get https://github.com/dotnet/installer/pull/19594 in and then make a re-bootstrap. That includes the roslyn fix.

All required rebootstrapping work is complete.  Closing.


Invisible Contents of FileDialog

There seem to be multiple conditions which cause a FileDialog to have invisible contents in 1.1 Stable. The behavior may be less deterministic in 2.0 Alpha.
In my experience (and in the attached example), all FileDialogs left with the default settings will not show the contents of the resources directory, although if you double-click where files and folders ought to be it will navigate through them.
The default access mode appears to be ACCESS_RESOURCES. Manually setting this will have no effect; the contents will still be invisible. For example:
extends FileDialog
func _ready():
	set_access(ACCESS_RESOURCES)

will not be usable. Setting the access mode to any other access mode behaves as expected. Furthermore, setting the access mode to something else and then back to ACCESS_RESOURCES before the FileDialog is even drawn appears to help in some cases:
extends FileDialog
func _ready():
	set_access(ACCESS_RESOURCES)
	set_access(ACCESS_USERDATA)
	set_access(ACCESS_RESOURCES)

The above will behave as expected in the example project, where the contents of the resources directory are visible.
But that workaround does not work in the actual project for which I'm trying to add a FileDialog. I have yet to figure out how to access the resources directory without the FileDialog's display of the resources directory's contents being invisible.
FileExample.zip

Downloaded your sample but can't reproduce the bug in e291294c7981f108dbb8658976b109df1850d303 build. Looks like it's fixed now, compile new build or download it from http://fixnum.org/godot/ and try to check your issue.

@kubecz3k  I am trying right now. Thank you for the swift reponse btw

@kubecz3k  I am on OSX. I cannot use the builds from  the link you provided since they are all for windows. This is a platform specific issue and likely Yosemite only issue.

@kubecz3k  disregard my previous comments i erased them . posted on the wrong issue

I just downloaded the newest build from http://fixnum.org/godot/15_11_03__12_34_12/tools/godot.windows.tools.64.exe and opened up the example attached in my previous post. Here's a video of it behaving badly: Video.zip

Might be related to #3263.

I just tested my original example again on a different computer, with both 1.1 Stable and Godot_v2.0_alpha_20150930_win64.exe. I observe the same issue there, even though there is little in common between the two machines. They're both running Windows 7 (only one is SP1), and they both have Nvidia cards, but one's a desktop with an older card and the other is a workstation laptop with a more recent GPU. I don't think I'll have access to a graphical Linux system anytime soon to see if that makes a difference.

My project seems to behave as expected in 2.0 RC1, although I don't remember the precise feature I was trying to add now. But also adding a call to popup() in my example causes it to work. There might be some initialization code there that was otherwise being skipped. Which maybe only affects certain video drivers.
I'll close this off, since I no longer have impacted use cases and perhaps the bug was fixed along the way.


Think about to fix the issues found by adapter checker

I am an automatic service that looks for possible errors in ioBroker and creates an issue for it. The link below leads directly to the test:
https://adapter-check.iobroker.in/?q=https://raw.githubusercontent.com/Ax-LED/ioBroker.powerfox2

[ ] [E405] Icon must be in the following path: https://raw.githubusercontent.com/Ax-LED/ioBroker.powerfox2/main/
[ ] [E407] Meta URL(latest) must be equal to https://raw.githubusercontent.com/Ax-LED/ioBroker.powerfox2/main/io-package.json

I have also found warnings that may be fixed if possible.

[ ] [W801] .npmignore not found

Thanks,
your automatic adapter checker.
P.S.: There is a community in Github, which supports the maintenance and further development of adapters. There you will find many experienced developers who are always ready to assist anyone. New developers are always welcome there. For more informations visit: https://github.com/iobroker-community-adapters/info

Thanks, that all bugs have been fixed.


ttwatchd does not work

With the update of ttwatch my ttwatchd deamon does not work anymore. Before that it worked just fine.
Files do not get pulled automatically of the watch and to use ttwatch i have to kill ttwatchd.
How to fix ttwatchd?
Current setup:
/etc/systemd/system/ttwatchdaemon.service

[Unit]
Description=Starts ttwatchd for tomtom sport gps watch to sync activity files automatically
[Service]
Type=forking
ExecStart=/usr/bin/ttwatchd --runas user:usb --get-activities --update-gps --update-fw --set-time -s /home/user/activities
[Install]
WantedBy=graphical.target

None of the files used by ttwatchd have changed for over 2 months, so the latest update cannot have broken it. The last 2 updates have only changed the main file for the ttwatch program. Have you tried deleting your build directory and doing a full rebuild?

Did you check your log? I have more or less the same problem. Daemon stopped working and I have to kill it to access the watch.  The log says
Sun Mar  5 14:39:40 2017: Watch connected...
Sun Mar  5 14:39:40 2017: Watch not processed - does not match user selection

There is no config file and I'm running it with
/usr/local/bin/ttwatchd --update-gps --set-time --runas=bioxz:tomtom
Everything besides the daemon works fine (as long as the daemon isn't running), I can update the GPS running ttwatch as a user. With the daemon running, there isn't even any output from --devices. Running the daemon without the -d should process any watch, right?

I haven't got that error, but I did notice today that the daemon wasn't working. It was broken by a pull request in January, well after this issue was opened. I have fixed it, so have another go.
Yes, running without -d will process any watch. You should still be able to run ttwatch, even with the daemon running, but bear in mind that the daemon will grab the watch as soon as it's plugged in, so you'll have to wait for it to finish with the watch before trying to use ttwatch to do other things.
I have noticed that the most recent firmware doesn't seem to report USB configuration strings correctly, so the device serial number is not available, which makes the device filter not work properly. You should still be able to filter by watch name though. Running lsusb -vvd1390: shows errors for the configuration strings, which used to work perfectly, so I think they have introduced a bug in the firmware recently.

Also for me the daemon is not working properly.
If i start the daemon with the watch already connected, the watch is recognized:
Sun Jun 24 21:37:37 2018: Watch connected...
Sun Jun 24 21:37:40 2018: Downloading GPSQuickFix data file...
Sun Jun 24 21:37:40 2018: Writing file to watch...
Sun Jun 24 21:37:40 2018: GPSQuickFix data updated
Sun Jun 24 21:37:41 2018: Current firmware is already at latest version
Sun Jun 24 21:37:41 2018: Finished watch

but if i connect later:
Sun Jun 24 21:38:08 2018: Watch connected...
Sun Jun 24 21:38:08 2018: Watch not processed - does not match user selection

The ttwatch command works correctly.
It's possible that the device filter wrongly analyze the music drive, instead of the workout drive?
Device is tomtom Adventurer, productID 0x7475 with latest firmware: 1.7.64
Here is the ouput of the lsusb -vvd1390: cmd:
Bus 001 Device 019: ID 1390:7475 TOMTOM B.V.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x1390 TOMTOM B.V.
  idProduct          0x7475
  bcdDevice            1.00
  iManufacturer           1 TomTom
  iProduct                2 TomTom GPS Music Watch
  iSerial                 3 HL4517I00012
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           64
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              4 Workout Drive
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      36
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0100  1x 256 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0100  1x 256 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              5 GPS Watch Music Drive
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

I enabled libusb debug putting libusb_set_debug (NULL, 4); in main and when the watch is hot-plugged i get this error:
[15.170678] [000009c8] libusb: debug [udev_hotplug_event] udev hotplug event. action: bind.
[15.170682] [000009c8] libusb: error [udev_hotplug_event] ignoring udev action bind

the error code of the function ttwatch_open_device in hotplug callback is TTWATCH_UnableToSendPacket.

seems to be a problem related to libusb: with version 1.0.17 daemon is working, but with version 1.0.21 (default in ubuntu 18.04) is not.

Sorry for taking so long to get to this. This was unfortunately caused by me failing to read the documentation on hot-plug events properly. I was calling synchronous libusb functions from within the hotplug callback handler, which is prohibited. It worked in previous verions of libusb, but not in later ones. I have updated the code to do this properly, and it works properly on my system. Hopefully it will fix your issues.


refactor(linter): move LintPlugins from LintOptions to LintConfig

Pure refactor. Moves plugin settings from linter options (which control the linter's behavior on a global level) and linter config ("which may or may not get adjusted on each file).

#6932  👈
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @DonIsaac and the rest of your teammates on  Graphite

Merge activity

Oct 28, 9:27 PM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.


win: bug: A number of tests failure when run under Windows OS

Test Failures FPiette.txt
Hello,
I build libuv with MSVC2010 using the source code downloaded from GitHub today.
A number of tests failed (See attache file for details):
not ok 26 - dlerror
not ok 37 - fs_copyfile
not ok 54 - fs_event_watch_file_twice
not ok 86 - fs_readdir_file
not ok 93 - fs_scandir_file
not ok 163 - pipe_connect_to_file
not ok 179 - poll_bad_fdtype
As fas as I can see, the failure are caused by the file or directory paths involved in the test. There are constant defined such as:
const char* path = "test/fixtures/load_error.node";
Under Windows OS, the path delimiter character is not the slash but the back-slash.
In my opinion, all such constants should replace the path delimiter by a new constant, defined as "/" for Linux and the likes and "\" for all Windows platforms.

Common misconception but forward slashes are legal path delimiters on Windows.
Since you're referring specifically to the dlerror test, that test checks whether uv_dlopen() copies the path verbatim into the error message.
Can you investigate why so many tests fail for you, e.g. by adding some printf statements right before the failing asserts?
Also, are you testing master or the v1.x branch? The v1.x branch is used for releases and is what you should normally use.

Make sure you run the tests from the root of the libuv folder - the one that has 'test' as a subfolder. (I  get the same errors if I run them from any other folder...)
@bnoordhuis : this appears to be a common mistake, is there anything that can be done to avoid it, like using absolute path names (via some makefile magic) in the test code?


test: fix date comparison not working in my timezone

The now() template builtin is being used in the test and is an alias
for datetime.utcnow(). The now however, just uses datetime.now(). This
means that my datetime.now() will always make this test fail.
Signed-off-by: David Stanek<EMAIL_ADDRESS>

Codecov Report

Merging #561 (cfd6918) into master (e4eccc2) will decrease coverage by 0.48%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #561      +/-   ##
==========================================
- Coverage   96.29%   95.81%   -0.49%
==========================================
  Files          41       41
  Lines        2701     2701
==========================================
- Hits         2601     2588      -13
- Misses        100      113      +13

Flag
Coverage Δ

unittests
95.81% <100.00%> (-0.49%)
:arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

tests/test_templated_prompt.py
100.00% <100.00%> (ø)

tests/conftest.py
84.61% <0.00%> (-7.70%)
:arrow_down:

copier/tools.py
85.71% <0.00%> (-7.15%)
:arrow_down:

copier/subproject.py
95.12% <0.00%> (-2.44%)
:arrow_down:

copier/types.py
85.18% <0.00%> (-1.86%)
:arrow_down:

copier/main.py
93.24% <0.00%> (-0.65%)
:arrow_down:

copier/template.py
96.87% <0.00%> (-0.53%)
:arrow_down:

copier/user_data.py
93.36% <0.00%> (-0.48%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4eccc2...cfd6918. Read the comment docs.

It seems you have pushed here the commits for #562. Can you remove them please?

Ah!! I was wondering where my comments went! I just commented on the wrong PR (where the commits shouldn't be haha).


Housekeeping

Hello, after testing and adding new features to the Chill&chat mobile app, many bugs and issues have been found that have to be fixed. This housekeeping issue is a mini-project to fix all the bugs found in the latest version that will be pushed out in the next one. Here is a list of the bugs to be fixed:
Modifier issue
This bug was mentioned in #81, but in short, when you use a modifier in the recent messages, it will be shown as plain text and have the risk of exposing API keys.
Socket connection for recent messages
This bug I think was also recently mentioned in #81. Again, in short, this issue is regarding the recent messages in the Menu screen, I need the recent messages to be updated when someone sends a message. This is done by creating a socket connection to the API and listening to messages.
Image rendering issue for  MessageOptions
When you go to the MessageOptions page(By long pressing the message bubble) and inspect an uploaded image, the image will throw an error, this is caused due to the fact that no key is provided and the API needs a key to function properly. So, we need to add a key to whether the image is from an external or an internal source.
Improvement: Greeting option to the RoomWelcomer
To improve user experience, we can add an option for the user to send a hello message to the room, the user can press a 'hello' gif to send it to the room. Please note that the other bugs will be a priority, if the other bugs do not get fixed in time, this feature would not be implemented
That's it, however I will add more issues below if needed.
Thanks!

BUG: Unable to use API after app restart
I have found a bug where when you restart the app on iOS, you cannot log in or signup. I am suspecting that this is caused due to the fact the environment variables are reset.
Reproduction

Download app
Start app
Quit app
Restart in task manager
Start again

System (1) information

OS: v16.2
Device: Apple iPhone 13 mini

System (2) information

OS: v15.unknown
Device: Apple iPhone X

System (3) information

OS: v16.2
Device: Apple simulator iPhone 14 pro max
Carrier of simulator: 2017 Macbook pro 13(intel)

This bug was found and exhibited on the systems above 👆
Thanks!


chore: revive old beacon tests

Summary of changes

Changes introduced in this pull request:

the Lotus issue should be resolved in the recent version merged in https://github.com/ChainSafe/forest/pull/4816/files. See https://github.com/filecoin-project/lotus/releases/tag/v1.29.2-rc1

Reference issue to close (if applicable)

Closes https://github.com/ChainSafe/forest/issues/4718
Other information and links

Change checklist

[x] I have performed a self-review of my own code,
[x] I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
[x] I have added tests that prove my fix is effective or that my feature works (if possible),
[x] I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

The logic was fixed in Lotus, but the performance of the new handling of it is still not acceptable to include it in the test. It takes over 2 minutes to get StateGetBeaconEntry response from new Lotus (previously it was sub-second).


Adapter crash when shutting down a certain proxmox node from cluster

All error are based from 0.1.0, so here all code links refer to this code base from 0.1.0
2018-09-29 08:53:59.926  - ESC[31merrorESC[39m: Caught by controller[1]: TypeError: Cannot read property 'uptime' of undefined
2018-09-29 08:53:59.927  - ESC[31merrorESC[39m: Caught by controller[1]:     at /opt/iobroker/node_modules/iobroker.proxmox/main.js:276:56
2018-09-29 08:53:59.927  - ESC[31merrorESC[39m: Caught by controller[1]:     at _get.then.data (/opt/iobroker/node_modules/iobroker.proxmox/lib/proxmox.js:42:9)
2018-09-29 08:53:59.927  - ESC[31merrorESC[39m: Caught by controller[1]:     at Request.request [as _callback] (/opt/iobroker/node_modules/iobroker.proxmox/lib/proxmox.js:119:21)
2018-09-29 08:53:59.928  - ESC[31merrorESC[39m: Caught by controller[1]:     at Request.self.callback (/opt/iobroker/node_modules/iobroker.proxmox/node_modules/request/request.js:185:22)
2018-09-29 08:53:59.928  - ESC[31merrorESC[39m: Caught by controller[1]:     at emitTwo (events.js:106:13)
2018-09-29 08:53:59.928  - ESC[31merrorESC[39m: Caught by controller[1]:     at Request.emit (events.js:191:7)
2018-09-29 08:53:59.928  - ESC[31merrorESC[39m: Caught by controller[1]:     at Request.<anonymous> (/opt/iobroker/node_modules/iobroker.proxmox/node_modules/request/request.js:1161:10)
2018-09-29 08:53:59.928  - ESC[31merrorESC[39m: Caught by controller[1]:     at emitOne (events.js:96:13)
2018-09-29 08:53:59.931  - ESC[31merrorESC[39m: Caught by controller[1]:     at Request.emit (events.js:188:7)
2018-09-29 08:53:59.931  - ESC[31merrorESC[39m: Caught by controller[1]:     at IncomingMessage.<anonymous> (/opt/iobroker/node_modules/iobroker.proxmox/node_modules/request/request.js:1083:12)

https://github.com/MeisterTR/ioBroker.proxmox/blob/d77717da053c4da53975b288eff5d2c61713f0ac/main.js#L276 ... seems that the node is there in this case in json but without data (because offline). Should be checked.
2018-09-29 08:55:04.686  - ESC[31merrorESC[39m: Caught by controller[2]: TypeError: Cannot read property 'name' of undefined
2018-09-29 08:55:04.686  - ESC[31merrorESC[39m: Caught by controller[2]:     at /opt/iobroker/node_modules/iobroker.proxmox/main.js:310:79
2018-09-29 08:55:04.686  - ESC[31merrorESC[39m: Caught by controller[2]:     at _get.then.data (/opt/iobroker/node_modules/iobroker.proxmox/lib/proxmox.js:54:9)
2018-09-29 08:55:04.686  - ESC[31merrorESC[39m: Caught by controller[2]:     at Request.request [as _callback] (/opt/iobroker/node_modules/iobroker.proxmox/lib/proxmox.js:119:21)
2018-09-29 08:55:04.687  - ESC[31merrorESC[39m: Caught by controller[2]:     at Request.self.callback (/opt/iobroker/node_modules/iobroker.proxmox/node_modules/request/request.js:185:22)
2018-09-29 08:55:04.687  - ESC[31merrorESC[39m: Caught by controller[2]:     at emitTwo (events.js:106:13)
2018-09-29 08:55:04.687  - ESC[31merrorESC[39m: Caught by controller[2]:     at Request.emit (events.js:191:7)
2018-09-29 08:55:04.687  - ESC[31merrorESC[39m: Caught by controller[2]:     at Request.<anonymous> (/opt/iobroker/node_modules/iobroker.proxmox/node_modules/request/request.js:1161:10)
2018-09-29 08:55:04.688  - ESC[31merrorESC[39m: Caught by controller[2]:     at emitOne (events.js:96:13)
2018-09-29 08:55:04.688  - ESC[31merrorESC[39m: Caught by controller[2]:     at Request.emit (events.js:188:7)
2018-09-29 08:55:04.688  - ESC[31merrorESC[39m: Caught by controller[2]:     at IncomingMessage.<anonymous> (/opt/iobroker/node_modules/iobroker.proxmox/node_modules/request/request.js:1083:12)

and seems same for VMs on this node :-)
https://github.com/MeisterTR/ioBroker.proxmox/blob/d77717da053c4da53975b288eff5d2c61713f0ac/main.js#L310

The change will not fix this ... Error is e.g. node_vals.uptime is Cannot read property 'uptime' of undefined ... means node_vals itself in undefined!!! Your check will produce the same exception. SO you need to check if node_vals === undefined ... same for the second one :-)

Did you saw this?

I have the same issue since I build my cluster.....
because this issue is open since 10.218 I assume the developer does not seem to have time or interest to working on it. This is a pity, because the adapter is quite useful.

Can you try the git version, apollon fixed it a few days ago

no success....

proxmox.0
2019-02-15 18:48:24.035
error
at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1083:12)

proxmox.0
2019-02-15 18:48:24.035
error
at Request.emit (events.js:211:7)

proxmox.0
2019-02-15 18:48:24.035
error
at emitOne (events.js:116:13)

proxmox.0
2019-02-15 18:48:24.035
error
at Request. (/opt/iobroker/node_modules/request/request.js:1161:10)

proxmox.0
2019-02-15 18:48:24.035
error
at Request.emit (events.js:214:7)

proxmox.0
2019-02-15 18:48:24.035
error
at emitTwo (events.js:126:13)

proxmox.0
2019-02-15 18:48:24.035
error
at Request.self.callback (/opt/iobroker/node_modules/request/request.js:185:22)

proxmox.0
2019-02-15 18:48:24.035
error
at Request.request [as _callback] (/opt/iobroker/node_modules/iobroker.proxmox/lib/proxmox.js:117:21)

proxmox.0
2019-02-15 18:48:24.035
error
at _get.then.data (/opt/iobroker/node_modules/iobroker.proxmox/lib/proxmox.js:42:9)

proxmox.0
2019-02-15 18:48:24.035
error
at /opt/iobroker/node_modules/iobroker.proxmox/main.js:218:27

proxmox.0
2019-02-15 18:48:24.035
error
TypeError: Cannot read property 'uptime' of undefined

proxmox.0
2019-02-15 18:48:24.035
error
uncaught exception: Cannot read property 'uptime' of undefined

proxmox.0
2019-02-15 18:48:24.030
debug
Request states for node MSHMCCU

please try again i add some debug informations.

here the output of the logfile
proxmox_debug.txt

i have to add the info that the failing node is only a quorum node and not a full size proxmox node. maybe this is the main issue in my case.
to explain this see https://blog.halnet.cloud/proxmox_add_a_raspberrypi_as_a_third_node/

is there also an error when the pi is online?

sorry for the delay...Unfortunately yes, because the pi is only a quorum node and not a proxmox server

please try again from git.

Looks very good now.. Adapter is running without errors. Good job..will check in detail tomorrow from my PC..because I'm currently in my mobile..
Outlook für Android herunterladen
On Sun, Feb 17, 2019 at 9:26 PM +0100, "MeisterTR"<EMAIL_ADDRESS>wrote:
please try again from git.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Looks very fine. All Nodes and VMs objects are available. good job, thx


develop way to automatically add a new language to language list at bottom of legal code

Once a new legal code translation is published, we currently have to manually add a link to it in the files of all previously published license translation files (6 for each language) in order to have it appear as an option in the language list at the bottom of the legal code. Is there a way to automate this process?
Assigning to @robmyers as discussed in the last legal/tech chat. Thanks!

@sarahpearson Without wishing to appear lazy, I wonder if this is something we could discuss with the web design people? Might be a good opportunity to implement this.

 But this sounds like a good idea
to me! Do you know what the process for that is?
On Wed, Jul 27, 2016 at 12:14 PM, Rob Myers<EMAIL_ADDRESS>wrote:

@sarahpearson https://github.com/sarahpearson Without wishing to appear
lazy, I wonder if this is something we could discuss with the web design
people? Might be a good opportunity to implement this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/creativecommons/creativecommons.org/issues/396#issuecomment-235654704,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF3lN_uarFxuOUZqPgbbxSgWylQtb_Reks5qZ5IFgaJpZM4JVcow
.

I implemented a script to add links for licenses.. It's been used for the last couple of translations and seems to be working well.


Testing reset unit test jiahao

Added a unit test case to check if the move to home function is working correctly
The program passed the test

Functionality: successfully output the test results.
Readability: resonable naming
Structure: Follows existing architecture design
Code Reuse: Correct import
Coding Standards: Reasonable branch name


Policies.append should take *policies instead on one policy

Closes: #25

@jsmadis there was a bug that would break the compatibility.

@pestanko Yeah I know what you mean. I didn't see it for the first time.


Add feature to add the event to calendar

Actual Behaviour
Currently the user can not add the event to his/her calendar
Expected Behaviour
Lets add a feature where the user can add the event to the calendar.
There are many ways in which we can have this feature, I'm listing some here:

Provide a single button to add the event to the calendar
Add feature to add individual session to the calendar

@mariobehling @Princu7 @aayusharora Please share your thoughts about this. Please feel free add more information if I missed something.

Is someone working on this or i can i claim?

Plz do

Can you please also tell me where should i place the button?😅

@geekyd as of now the app does provide download as ics option so can you please clarify what exactly needs to be done?

I am working on this.

Added this feature in #1967, closing this issue.


Check GagesII sites w/o peak flow

REMINDER - DO NOT MERGE
Add code (and log with summary) to identify extra sites with daily flow data but without peak flow data.

Thanks for making this summary. We can discuss on Monday, but I think it's okay to drop these sites instead of programming functions to retain them for the FDC metric calculations. I'll leave this open until after our meeting

Not merging - discussed on 02/07/2022. Only 8 sites without peaks that contain daily flows (out of > 2000); determined that this was a 'non-issue'. Closing without merging.


404 when downloading documents

We're experiencing a consistent 404 error on any files we try to download. I've tried this on different OSes, browsers, and networks and I still get the same Nginix 404 Page.
Error can be encountered at the following: https://media.speechdrop.net/uploads/CNPwwe/2/network.gv.pdf
I tried creating a different room and still experienced the same issue.

It was a permission issue, thanks for letting me know.


Add Vimeo embed support

This PR adds a new package to support embedding Vimeo videos! Uses a custom <lite-vimeo> web component implementation as we can simplify the component even more than existing solutions thanks to the server-side rendering Astro will do.

Thanks!!


My try to implement the server-side filtering with standard javascript RegExp

I've done this small and silly enhancement to achieve the "tail | grep" functionality, since we have very busy asterisk logs so we need to filter it before sending to browser.
Let me know if it looks appropriate for frontail package.

Hey, thanks for PR but I need to reject that change. I'm planning to add support for stdin so there will be no problem with greping before sending to frontail. I've just created issue for that https://github.com/mthenw/frontail/issues/68.

Cool, that would be fantastic! Waiting for this feature, thanks!


Serializer

Serialization as a class responsability, removing the normalizer

I'm not comfortable with the links between entities

Do you mean the "extends JsonDeserializable" ? Why are you not comfortable with that link?


[Process Agent] Integration Tests for Config

What does this PR do?

This PR utilizes the kitchen-test framework to test the new process_config.process_collection.enabled and process_config.container_collection.enabled settings
Motivation

Additional Notes

Huge thanks to @KSerrania for helping me to get this working!!
Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Reviewer's Checklist

[ ] If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
[ ] The appropriate team/.. label has been applied, if known.
[ ] Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
[ ] A release note has been added or the changelog/no-changelog label has been applied.
[ ] Changed code has automated tests for its functionality.
[ ] Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
[ ] If applicable, docs team has been notified or an issue has been opened on the documentation repo.
[ ] If applicable, the need-change/operator and need-change/helm labels have been applied.
[ ] If applicable, the config template has been updated.

Currently the container tests will not work until https://github.com/DataDog/datadog-agent/pull/10605 is merged. Will rebase once it is merged


Favicon added

Fixes
Fixes #6 by @Lakshay-Pruthi
Description
Favicon was not present. Now the favicon is added.
Code indentation of index.html also got fixed by default.
Checklist

[x] My pull request has a descriptive title (not a vague title like Update index.md).
[x] My pull request targets the default branch of the repository (main or master).
[x] My commit messages follow best practices.
[x] My code follows the established code style of the repository.
[ ] I added or updated tests for the changes I made (if applicable).
[ ] I added or updated documentation (if applicable).
[x] I tried running the project locally and verified that there are no
visible errors.

Developer Certificate of Origin

For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@Lakshay-Pruthi +1 to the above comment about items missing.
Hi! I really appreciate the enthusiasm here, but I would also kindly acknowledge that the Issue in question is still sitting in "awaiting triage" and if you read through the Contribution Guidelines shouldn't be worked on or have a PR submitted against it yet.
There is a plan to reconsider our current use of app icons and favicon inclusion that hasn't resolved, so I'm leaving this PR open until that's settled.

@possumbilities I apologize for forgetting to check the labels, Not making any changes to the PR till the reconsideration happens.


ArticleAbstractSkel TypeError: metaclass conflict

Cannot be a metaclass on this way, because Skeleton is already a metaclass
https://github.com/viur-framework/viur-shop/blob/6483747f0d0e79410d04bd22cc01141a94076b87/src/viur/shop/skeletons/article.py#L8-L9

ABC is not working here anyway since we don't instantiate Skeletons.
With ABC we could do sth like this
# class CombinedMeta(MetaBaseSkel, abc.ABCMeta):
class CombinedMeta(MetaSkel, abc.ABCMeta):
    def __init__(cls, name, bases, dct):
        print(f"Call CombinedMeta.__init__({cls=}, {name=}, {bases=}, {dct=})")
        MetaSkel.__init__(cls, name, bases, dct)
        abc.ABCMeta.__init__(cls, name, bases, dct)

class ArticleAbstractSkel(abc.ABC, Skeleton, metaclass=CombinedMeta):

see https://stackoverflow.com/a/57351066/3749896

Therefore I solved this in https://github.com/viur-framework/viur-shop/commit/782e3d156807b0ae465f186b45791911e70bde90 customly


Correctly unify typeclass constraints when inferring types

When a TypeVariable with typeclass constraints are unified with a TypeOperator, the type system (i.e., unify in hindley_milner.py) does not check to see if the TypeOperator is actually a member of the required typeclasses. As a result of this, some TypeErrors related to typeclass membership will not be raised until function-call time (as opposed to function-compose time).
For example, consider show (of the Show typeclass). When show is composed with id, the typeclass constraints will be unified and the composed function will have the correct constrained type. If you compose show with a function with a concrete (TypeVariable) output type which is not a member of Show, the type inference system will not check the constraint and raise a TypeError until the composed function is actually called.

The solution might lies in this place since you didn't copy the constraints to the new TypeVariable.

BTW you can try to add an option for Arrow in the fresh function since you might encounter the function with sig (int -> int) be copyed into (-> int int), which looks terrible...
p.s. I do appreciate this awesome project, but it seems to be dead for quite a while... I feel sorry about it.


Oracle support

I am trying to enable oracle support by adding a file oracle.go to
/internal/database/
I use docker with oracle xe to boot of a instance of oracle to test.
but I have some question:

[Solved]I download the project but could not compile, I could unit test with oracle_test.go
The test case seem not complete. [in progress]
Seem keyword.go need to be update. Any other file is related to db connection? [Working on the branch]
does the password is required to coded in the config? [Hard code as a temp solution]

Are there any related document about this?

@PhilipMok-cc did you make any progress on this? Wanted to take a stab at this myself as well and curious how far you got.

Actually looks like something was merged via 6329f68115410446daa84ff73e11e6995ce5342b, awesome!

If you still have this issue, please file new issue. I guess this is already resolved.


Distinguish temporary and persistent native callbacks with lightfuncs

@JoshMarler this is a follow up to #89, adding one more commit that distinguishes temporary native callbacks (e.g. canvas context methods) from persistent native callbacks (e.g. registerNativeMethod), using a limited pool of lightfuncs for the former and our duk_finalizer approach for the latter, with duktape running it's gc whenever it deems appropriate.
After a very cursory profile of the GainPlugin, this looks to me like a 5x performance speedup on the canvas paints, which is awesomeee.
Take a look, let me know if you like the approach, and I'd also be very curious to hear a profile with your app!

Ok just finished a big rebase onto master after merging #89, and I went in and fixed up everything you mentioned as well. This is ready to merge, but I want to wait until we can confirm that there's no long-running lockup issue. Let me know when you get any more info on that.
I'm also going to open one more inline discussion as I mentioned in #89 on the subscribe functionality

Hey @JoshMarler have you had a chance to look into the long-running lockup issue any more?

Hey Nick, apologies I've been stuck on a couple of completely unrelated bugs. I'll be able to take a pass at this tomorrow. However, my app locked up this morning and that was using the current master so you can probably merge this down if you're not seeing similar issues on your end.

No worries! Interesting, ok, good to know. Curious if there's something else in here going awry...

Yeah for sure.  I've been fighting obscure TS/Babel issues. Turns out authorising a TS component library that works in duktape is a bit of a pain !

I've been fighting obscure TS/Babel issues for a few days so I've ignored this. Turns out authorising a TS component library that works in duktape is a bit of a pain !

Hmm... interesting. You've now gone the furthest (I believe) into the realm of typescript+blueprint+duktape. I wonder, leaning on your experience with it so far, should we consider leaving out Typescript integration until after we reach a solid beta milestone?

I reckon I'll have an answer for you on that in a couple of days! I literally have one problem left to solve which is basically that the Babel polyfills/transforms don't seem to be getting applied despite being present in the final bundle. I.e. Array.from.and friends. Might strike up a chat with you tomorrow on Discord just incase you have any ideas. You might be better at understand webpacks bundle output!

Sounds good!


fix: remove upper limit for required terraform version

/run pipeline

│ Error: job is failed: mas-inst1-pipelines/mas-deploy-job
│
│   with module.existing_cluster.helm_release.maximo_helm_release,
│   on ../../main.tf line 8, in resource "helm_release" "maximo_helm_release":
│    8: resource "helm_release" "maximo_helm_release" {
│
╵}

Retrying..

/run pipeline

Failed with:
│ Error: context deadline exceeded
│
│   with module.existing_cluster.helm_release.maximo_helm_release,
│   on ../../main.tf line 8, in resource "helm_release" "maximo_helm_release":
│    8: resource "helm_release" "maximo_helm_release" {
│
╵}

Retrying..

/run pipeline

The pipeline failed with same issue. Team are debugging, however its unrelated to changes in this PR. Going to force merge this PR, since there is no risk with the type of change here

:tada: This PR is included in version 1.7.6 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Fix hooks experience in CLI

This is meant to be a helper PR of https://github.com/prismagraphql/prisma/pull/2562

Failure of get-schema command must result in a non-zero exit status code.

Addresses https://github.com/graphql-cli/graphql-cli/issues/286 partially.

:tada: This PR is included in version 2.16.2 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Das_Geek: Watch boardinfinity.com

Das_Geek requests the watch of the watch_keyword boardinfinity\.com. See the MS search here and the Stack Exchange search here.

boardinfinity\.com has been seen in 1 true positive, 0 false positives, and 0 NAAs.

Approved by double-beep in Charcoal HQ


Replace token app useTransaction hook with react helper version

We have some duplicated logic between apps/token and libs/react-helpers. Both use their own useTransaction hook. Lets convert the token app to use the react-helper version.

Merged with #1513


Move some tests from sp-mvm to runtime.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 41.25%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
113

Relevant Lines:
214

💛  - Coveralls

Hi there,
There is already tests for runtime, what's reason to create also runtime/tests/common?


Added feature to pass either serviceinstance id or name to machine spec

/cc @mkumatag

should I address paging and caching in this PR or can I create a submit PR for that

should I address paging and caching in this PR or can I create a submit PR for that

can be addressed part of a different PR, lets create task somewhere to track this.


Create composer.json

Create composer.json file. It is useful for those using php's composer

https://github.com/necolas/normalize.css/search?q=composer&type=Issues&utf8=✓

#185 #308 #391

After seeing those comments. I agree this is probably unnecessary bloat. Closing PR now.


Simplify Readers and Writers

Simplify codegen for readers and writers by using shared abstract base classes

Made all componentID's that were added static, so it will only be looked up once per type


[WIP] Move static vessel data to  defaults.json

Move the vessel identity and info to defaults.json from settings file. Replaces #182.

Is this a breaking change so that existing settings files will no longer work @sbender9 ?
If it is I think it would be a good idea to add some code that tells the user what has changed and how to fix it. We can add some log statements about missing identity and possibly even allow the server to start but go into an error state where any http requests will return an informative message.
Does this affect rpi-setup.sh @joabakk ?

Is there a way of calling defaults.json when it is out of settings folder?

@sailoog what do you mean by calling? If you use some data from here it would be much better to use the sk server’s http api to get the data.

We start the server running:
~/.config/signalk-server-node/bin/signalk-server -s ../../.openplotter/openplotter-settings.json
Because we want the settings file out of the installation folder.
defaults.json is supposed to be always in ~/.config/signalk-server-node/bin/signalk-server/settings/
Could we place this file out of settings folder?

You can use the new -c argument. It takes a path to a directory and will look for settings.json and defaults.json in that directory. (also puts plugin settings there)

@tkurki @joabakk this code is so old, I think it definitely needs re-visited

You can use the new -c argument. It takes a path to a directory and will look for settings.json and defaults.json in that directory. (also puts plugin settings there)

@sbender9 Thanks!!! I was about to request something similar.

I can PR the rpi-setup to this branch prior to merging

I would like to see this merged, I think configurations will be more intuitive this way

Now that settings has an API this needs more work.  Continue or abandon?


Sharing port

Hi. I wonder if it's somehow possible to share same port with node.js classic https server.
I'd like to smoothly move to uWebsocket.js and need to allow connecting the old way for some time too.

Hello no you have to solve that transition in other ways


Cloudflare WARP <IP_ADDRESS> doesn't start up at all

Example URL(s)
https://community.cloudflare.com/t/cloudflare-warp-doesnt-launch/415915
Actual Behavior
As the title says, nothing happens when I click the icon. I see the loading circle by my mouse for a second, then it's gone, and nothing happens. The app does not work.
Expected Behavior
I'd like the app to work, that'd be cool.
Additional information
No response

Howdy @Choshako, I'll pass this along internally... but can't do anything on product functionality as this is a docs repo (and a docs team).


Set initial value for the uploader widget

Set initial value for the uploader widget
Is there a way to set the initial value with any of the uploaders, more specifically, the Minimal one? If not, could anyone please direct me on how it can be done?
Thanks!

It can be set via the addFileFromUuid method (see Uploader API). Here's an example:
function App() {
  const uploaderRef = useRef<InstanceType<UploadCtxProvider> | null>(null);
  useEffect(() => {
    const api = uploaderRef.current?.getAPI();
    api?.addFileFromUuid(uuid, { // uuid – UUID of a file you want to pre-load
      silent: true,
    });
  }, []);

  return (
    <>
      <FileUploaderMinimal apiRef={uploaderRef} pubkey="demopublickey" />
    </>
  );
}

Sorry for commenting on the closed issue, there really should be a "value" prop of some sort made of files or uuids to better match react API


Fixed mobile view for Navbar

Description

Issue Ticket Number
Fixes #383

Type of change

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

Checklist:

[x] I have followed the contributing guidelines of this project as mentioned in CONTRIBUTING.md
[x] I have checked to ensure there aren't other open Pull Requests for the same update/change?
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes needed to the documentation

@itsmeAnubhab Closing this PR as Due to some error I can't deploy it on vercel for this specific PR. Please make a different PR with the same changes in the main.

@itsmeAnubhab Also take care of this issue

Before pushing take pull from main to avoid Merge Conflicts

ok


Notifications propagates

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Login to account A which has some unread notifications.
Logout without marking them as read, Log into account B which previously didnt have any notifications.
You will see that unread notification count (in step 1) again for account B.
Step 4, No step 4.

Expected Result:
Only see your notifications.
Actual Result:
Notifications propagate.
Workaround:
Don't know.
Platform:

Where is this issue occurring?

Web

Version Number:
Reproducible in staging?:
Reproducible in production?:
Logs: NA
Notes/Photos/Videos:  NA
Expensify/Expensify Issue URL: NA
Issue reported by: @hanaffi
Slack conversation:
View all open jobs on GitHub

Triggered auto assignment to @flaviadefaria (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

I still have a few tasks on my plate, I'm going to add the external label

@parasharrajat My main account was banned without warning and we came to an agreement to only report bug on Github without accessing Slack.
Sorry for this misconception.

@parasharrajat Well, My account was banned without warning. So I'm using this alt account to report bugs.
Sorry for this confusion.


fixing date format for numpy change

Please refer #194. Both fix the same issue with slightly different solutions.


Composite operation option vs. Blend Mode option?

I am rewriting the composite operation description in the doc when the Map Wizard / Composite operation option appears when the map type is Simple, Choropleth, Bubble, Density.
However, when the map type is Torque or Torque Category, this option appears as "Blend Mode".  Even though the underlying CartoCSS code is comp-op for both.  See example image below....
Can you rename the Blend Mode options to Composite operation for consistency? (If there is a design reason for the difference, please let me know and I will document).

@saleiva , I should have tagged you to assign accordingly. Apologies.

Fixed on the builder


building examples fails from the project top

I can compile the examples correctly if I go into the examples/ directory.
But when stay in the top gitrepo root , when I try to compile the examples, I get some errors (for the index.js example only)
$ ./bin/nexe -i ./examples/hello-world/browser.js -o browser
$ ./browser
hello browser!

$ ./bin/nexe -i ./examples/hello-world/index.js -o index
$ ./index

nexe.js:0
(null)

Error: unable to load nexe
    at _require (nexe.js:12:19)
    at entries (nexe.js:29:20)
    at _require (nexe.js:14:49)
    at nexe.js:39:9
    at nexe.js:41:3
    at NativeModule.compile (node.js:619:5)
    at Function.NativeModule.require (node.js:587:18)
    at Function.Module._load (module.js:297:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)

In the generate code I see:
 define("91fddc0f/index.js", function(require, module, exports, __dirname, __filename) {
     var http = require("nexe");
     var fs = require("fs"), path = require("path"), port = 1337;

The http require has been replaced by nexe. It seems that this sardines doing.
It takes the name from the package.json file in the top root. (nexe)

Talk about ancient.   Sardines has been replaced.  Please reopen if this is still an issue.


add support for local templates

when developing new templates for https://github.com/recursiveai/tenpureto , we want to try them out to make sure they work when downloaded with ganzo.
But development is hindered by the fact that the templates to function properly need to have some parts of it "resolved", like pyproject.toml.nzo file.
By adding support to loading local templates with ganzo, we can simulate the resolution of the templates without first having to upload them to the cloud.

As of version 0.2.1 gonzo can also handle templates defined locally.


add portfolio joanybuclon.com

This PR is:

[x] Adding a new domain
[ ] Updating existing domain size
[ ] Changing domain name
[ ] Removing existing domain from list
[ ] Website code changes (512kb.club site)
[ ] Other not listed

[x] I used the uncompressed size of the site
[x] I have included a link to the GTMetrix report
[x] The domain is in the correct alphabetical order
[x] This site is not a ultra lightweight site
[x] The following information is filled identical to the data file

I confirm that I have read the FAQ section, particularly the two red items around minimal pages and inappropriate content and I attest that this site is neither of these things.

[x] Check to confirm

- domain: joanybuclon.com
  url: https://joanybuclon.com/
  size: 433
  last_checked: 2023-03-30

GTMetrix Report: https://gtmetrix.com/reports/joanybuclon.com/rgcBoS2h/

Thanks for adding your site!


fix(viz-date-control): Just use global DEFAULT_TIME_FORMAT instead of hardcoding 'smart_date'

SUMMARY
Some visualizations in the date formatter control specify a default date format 'smart_date'. However, it is recommended to use the DEFAULT_TIME_FORMAT instead of hardcoding a specific format.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

[ ] Has associated issue:
[ ] Required feature flags:
[ ] Changes UI
[ ] Includes DB Migration (follow approval process in SIP-59)

[ ] Migration is atomic, supports rollback & is backwards-compatible
[ ] Confirm DB migration upgrade and downgrade tested
[ ] Runtime estimates and downtime expectations provided

[ ] Introduces new feature or API
[ ] Removes existing feature or API

@supersetbot orglabel

Hmm, tabs.test.ts cypress test has been failed, but my code does not affect to the tabs functionality(


autoplayHoverPause does not resume on mouse leaving

With autoplayHoverPause set to true, I am getting the expected result of the carousel pausing when my mouse hovers over the carousel area. However, upon moving my mouse out of the carousel area, it does not resume autoplay. Autoplay is only resumed after clicking one of the nav items (either next or prev).

+1 having the same problem :(


Search doesn’t seem to be working consistently

If I search for zap or lightning I don’t get the ⚡ emoji. Search is generally slow and inconsistent.

Hi! I'll give it a look.
Seems that someone posted my workflows into Alfred Gallery and now I'm getting a decent amount of requests.
Thanks for letting me know.
Fede

@nourmalaeb I think I fixed it on the version v1.9.1.
I'll try to speed up the search when I have more time.
Please, feel free to check it out and tell me if its a bit better.
Cheers,
Fede.

Thanks @fedecalendino — how do I update to v1.9.1? Do I need to build from source?

You need to download and install the alfred file within the releases section in this repo. on the right.

Sorry this is all I’m seeing — there’s no alfred file, just the source

There’s absolutely no rush on this, just letting you know.

It's all right! It seems that the upload failed.
Should be there now.


[Improve][github template] Improve current template and feature template

Documentation Scope
Briefly explain what is the documentation is referencing (main README, a specific plugin etc.)
Describe the Change
Improve current template and feature template
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.

Hi @SnowMoon-Dev , do you mean the template for creating documentation issues?
I'll take a look at it.

yes


Cluster discovery via server info

Implements cluster auto discovery which 0.9.2 server now supports
Bumps gem to 0.8.0 major version

Guessing a doc update is pending but with this you only tell the gem one server in a cluster and it discovers new ones and will fall over to them?
On fall over will it again discover a new set and expel ones not valid anymore? I have very long running clients - months - so for this kind of thing to make sense there must be some runtime refreshing.

Yes doc updates are pending, but it basically works as you mention.  As new nodes attach to the cluster the clients puts them on the list of nodes to which it can connect as server announces them. During fail over, it will back off in case any of those servers failed previously when attempting to reconnect.

Oh so even during the normal connection as servers come and go they will be announced and the client will update its state - without having to reconnect to get a new list?
That is amazing if that's how it works. Really good thanks

Yes that is how it works, not needed to reconnect to get new list of servers as long as nodes attach to the same cluster /cc @kozlovic

Brilliant thank you. That'lol hugely simplify life

When the client library connects to a server that is already part of a cluster, it will get the list of connect URLs of all servers, and add it to its list of servers. These will be used during a reconnect.
Note that when servers come up and go in the cluster, there is no update to client (unless their listen spec has changed). So there is no URL removal with this change.
But as Wally mentioned, server URLs that are tried more than the configurable reconnect attempts are removed from the pool of server URLs, so they won't be tried more than what is configured.

When I wrote "come and go", I am talking about a server that is stopped/restarted, not new server added to the cluster. Say that you have a cluster of servers A, B and C (full mesh). If a client connects to A, it will be sent the list of B and C. Now say C is stopped, there is no update to clients. C is brought back up, there is still no update to clients. D joins the mesh, clients will be notified of this addition.

I see thanks. Live topology updates would be super handy for people who elasticly build their cluster but as is its already a good advantage - cluster members come and go on different IPs. For now I use SRV in my client code and update the record dynamically.
I realise achieving live updates is a MATS protocol change and so probably quite unlikely


Integrate kH Director

May I know how you come out with the configuration in sensordata.json? I would like to integrate the kH Director into the system but have no clue how to modify the json file.
It will be good if you can point me to the documentation that you refer to as well.

Hi Alex, the variable replacement works as documented in User designed web pages for ProfiLux 3 & 3.1. I don't have access to a kH Director so I'm not entirely sure whether its data can be accessed through these tokens


Uncaught Error: Cannot find module 'jquery'

Hi,
I'm trying to use angular-summernote in a Electron app, but i keep getting this error when i include summernote.js in my project:

Uncaught Error: Cannot find module 'jquery'
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename (C:\Users\me\AppData\Roaming\npm\node_modules\electron\dist\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at file:///C:/Users/me/projects/FO/dist/vendors/summernote/summernote.js:18:30
at file:///C:/Users/me/projects/FO/dist/vendors/summernote/summernote.js:23:2

I'm using other jQuery plugins in this project without any problems.
Any ideas how to resolve this issue?

Below solution worked for me.
Installing jquery in npm package to your local machine, type the below into your command line. You’ll notice a node_modules directory appear in your root where the package is now installed.
npm install jquery
And then add below line in your html file.


No Resources found error after login

After logging into the xpresso, I see there is an which pops out "No Resources found"
I even tried restarting the resources using below command,
docker-compose restart resources
Version:21.3

Please check section 3 of the readme. This is an issue with elasticsearch setup. Ensure the virtual memory values for the host are properly set and that the log and data directories have the correct permissions. After correcting those, bring both elasticsearch and resource containers down and back up.

I followed the steps and It actually resolved my issue,
Thanks!!!


Fix bad td label

Fix bad label when using TH children that are react components.
In this case:

    Test it

    Description

I got this DOM:

Regards

This is definitely a bug, but I'm curious if there's some other option we can use for a key if the label isn't easily stringable

Too old. I close


Add contentMediaType for variants object

Unfortunately I was not able to find proper spec in the Twitter API for this before, and only way to really test this is to have it in the package and use it.
Or could we somehow test this in the demo app @daneden ?
As for this PR, I presumed that mediaType and contentType are the same, however from a bit of testing it turns you types slightly differ in strings, so we needed a new enum to handle that.

This is my bad; I should really have asked for tests in your other PR(s)!
If you check out the tests folder you should be able to copy one for testing these changes by making sure accessing properties works as expected. It's based on the Twitter v2 OpenAPI spec which they use for their own playground development and some docs generation.

Oh got it. Will look into that today and add them in 🙌

So not really sure how to test this inside an array tbh. I guess you were referring to one of these tests?
  func testAddListMember() async throws {
    let addListMemberResult = try await TwiftTests.userAuthClient.addListMember("0", to: "0")
    XCTAssertTrue(addListMemberResult.data.isMember)
  }

All I can see that I can do to test if the types are there is this. But can only check if they are accessible from within so not sure if that helps testing the public security access level?
final class TwiftTypesTests: XCTestCase {
  func testMediaVariantsBitrateAccessible() async throws {
    let getTweetResult = try await TwiftTests.userAuthClient.getTweet("0")
    XCTAssertNil(getTweetResult.includes?.media?.first?.variants?.first?.bitRate)
  }

  func testMediaVariantsContentTypeAccessible() async throws {
    let getTweetResult = try await TwiftTests.userAuthClient.getTweet("0")
    XCTAssertNil(getTweetResult.includes?.media?.first?.variants?.first?.contentType)
  }

  func testMediaVariantsUrlAccessible() async throws {
    let getTweetResult = try await TwiftTests.userAuthClient.getTweet("0")
    XCTAssertNil(getTweetResult.includes?.media?.first?.variants?.first?.url)
  }

}

Or did you mean for me to instantiate a mock media object?

Oh I see, you mean testing the access levels! Yeah I think since Twift is annotated with @testable in the test suite it will ignore access levels. I'd recommend testing changes related to access levels via the demo app.

Oh I see, you mean testing the access levels! Yeah I think since Twift is annotated with @testable in the test suite it will ignore access levels. I'd recommend testing changes related to access levels via the demo app.

Right! Inside the demo app it is 👌 to test, but not sure how I can write actual tests to see if the data is there?
Another note, just tested it with the latest UTType change, it doesn't work. But it does with the previous ContentMediaType 🤷♂
I will read more about UTType in general, maybe I wrongly assumed it would work without anything more custom.

@roblack yeah I noticed UTType doesn't work as expected here; I think because the decoding initialiser expects an identifier(e.g. "public.mpeg4") instead of a MIME type (e.g. "video/mp4"). It may make sense to just decode contentType as a String to account for arbitrary future MIME types that may be returned. Then library users can do with it whatever they need to (such as casting to UTType to do their own content decoding or streaming)

not sure how I can write actual tests to see if the data is there?

Unfortunately it looks like Twitter's OpenAPI spec doesn't make this as easy as I had hoped either.
Basically, it only synthesises some types correctly. Here's an example payload from GET /2/tweets/{id} based on their OpenAPI spec:
{
  "data": {
    "author_id": "2244994945",
    "created_at": "Wed Jan 06 18:40:40 +0000 2021",
    "id": "1346889436626259968",
    "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
  },
  "errors": [
    {
      "detail": "string",
      "status": 0,
      "title": "string",
      "type": "string"
    }
  ],
  "includes": {
    "media": [
      {
        "height": 0,
        "media_key": "string",
        "type": "string",
        "width": 0
      }
    ],
    "places": [
      {
        "contained_within": [
          "f7eb2fa2fea288b1"
        ],
        "country": "United States",
        "country_code": "US",
        "full_name": "Lakewood, CO",
        "geo": {
          "bbox": [
            -105.193475,
            39.60973,
            -105.053164,
            39.761974
          ],
          "geometry": {
            "coordinates": [
              -105.18816086351444,
              40.247749999999996
            ],
            "type": "Point"
          },
          "properties": {},
          "type": "Feature"
        },
        "id": "f7eb2fa2fea288b1",
        "name": "Lakewood",
        "place_type": "city"
      }
    ],
    "polls": [
      {
        "duration_minutes": 5,
        "end_datetime": "2019-08-24T14:15:22Z",
        "id": "1365059861688410112",
        "options": [
          {
            "label": "string",
            "position": 0,
            "votes": 0
          },
          {
            "label": "string",
            "position": 0,
            "votes": 0
          }
        ],
        "voting_status": "open"
      }
    ],
    "topics": [
      {
        "description": "All about technology",
        "id": "string",
        "name": "Technology"
      }
    ],
    "tweets": [
      {
        "author_id": "2244994945",
        "created_at": "Wed Jan 06 18:40:40 +0000 2021",
        "id": "1346889436626259968",
        "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
      }
    ],
    "users": [
      {
        "created_at": "2013-12-14T04:35:55Z",
        "id": "2244994945",
        "name": "Twitter Dev",
        "protected": false,
        "username": "TwitterDev"
      }
    ]
  }
}

As you can see in the above includes.media example, not only does the OpenAPI spec prevent us from requesting additional fields (such as variants), but it also doesn't have correct types for e.g. the type field. Short of providing feedback to the Twitter Developer team, the best approach is probably a combination of tests for supported structures such as Tweet as well as some property testing in the demo app.


Can i use it as a buildModules?

Nuxt v2.9 suggest to use 'static modules' as build modules..
It's possible with this one?
Read here - and here

Perhaps you could test it and let me know?

Yes, it's possible and i think it's the suggested way 🚀
Can i open a PR to update the README file with this advice?

Please do :smile:

Done PR

@robcresswell I believe we can close this issue now with the merging of #15 earlier today. Thanks @LuXDAmore !

Good point, closed

Thank You!!
@azrikahar @robcresswell


Bug: Private key with only 42 bytes leads to error when creating an update operation

It can happen, that one of the private keys (recovery or update) starts with a null byte and hence has a length of 42. This will lead to an error when running an update operation because the LocalSigner from ion-sdk requires it to be of length 43.
Steps to reproduce:

Clone this repository and install dependencies with npm i
(when using the packaged version, you may apply the fix from #14 locally in node_modules\@decentralized-identity\ion-tools\ion.js\lib.js:172 (createUpdateRequest), otherwise you will get an error in \@decentralized-identity\ion-sdk\dist\lib\InputValidator.js:25 when generating the update operation: Cannot read properties of undefined (reading 'crv'))

Copy the following code to a file in the top directory and run it, e.g. node short-key.js

const ION = require("./ion.js/lib");

async function main() {
  /*let i = 0;
  while (true) {
    i++;
    const did = new ION.DID();
    const operations = await did.getAllOperations();
    const ukl = operations[0].update.privateJwk.d.length;
    if (ukl != 43) {
      console.log(JSON.stringify(operations, null, 2));
      break;
    }
    if (i > 1000) {
      console.log("no short key found after", i, "cycles");
      break;
    }
  }*/

  // create DID with "short" private key
  const did = new ION.DID({
    ops: [
      {
        operation: "create",
        content: {},
        recovery: {
          publicJwk: {
            kty: "EC",
            crv: "secp256k1",
            x: "qSYL-SqJLkOg1q_Ifox9m77W_PvJL7YZQQIjkT3c1Rw",
            y: "dnm91aw22U7cYF-CMSmJa8LbAgGahlWnJmlwKJYTwEU",
          },
          privateJwk: {
            kty: "EC",
            crv: "secp256k1",
            d: "mR-2ioKyTea6rBHmZR5YaGYEHRSljWpiJ8MVaBacN44",
            x: "qSYL-SqJLkOg1q_Ifox9m77W_PvJL7YZQQIjkT3c1Rw",
            y: "dnm91aw22U7cYF-CMSmJa8LbAgGahlWnJmlwKJYTwEU",
          },
        },
        update: {
          publicJwk: {
            kty: "EC",
            crv: "secp256k1",
            x: "WS0zURYuE45OLuZTr6nNWfWO8xCLszHBqXQEDhSw2To",
            y: "t3VlvV1zHxTLZkXJvUTJt-7b7BGitzOrRtm-Ogb0ODM",
          },
          privateJwk: {
            kty: "EC",
            crv: "secp256k1",
            d: "MRKXkIv44DkLOQY1ZZj-mMfixI9aHh7i97xy9eewOw", // <-- private key starts with a null byte -> only has length 42
            x: "WS0zURYuE45OLuZTr6nNWfWO8xCLszHBqXQEDhSw2To",
            y: "t3VlvV1zHxTLZkXJvUTJt-7b7BGitzOrRtm-Ogb0ODM",
          },
        },
      },
    ],
  });

  // the following workaround lets it work locally for me
  const key43b = Buffer.from(Buffer.from(did._ops[0].update.privateJwk.d, "base64").toString("hex").padStart(64, '0'), "hex").toString("base64").slice(0,43);
  //did._ops[0].update.privateJwk.d = key43b; // <-- uncomment this line to see the "fix"

  // now, generate an update operation
  const op = await did.generateOperation("update", {
    addServices: [
      {
        id: "domain-1",
        type: "LinkedDomains",
        serviceEndpoint: "https://example.org",
      },
    ],
  });

  const reqBody = await did.generateRequest(1);
  console.log(op, reqBody);
}
main();

It will show an error:

[...]\ion-tools\node_modules\@decentralized-identity\ion-sdk\dist\lib\InputValidator.js:38
            throw new IonError_1.default(ErrorCode_1.default.JwkEs256kHasIncorrectLengthOfD, `SECP256K1 JWK 'd' property must be 43 bytes.`);
                  ^

IonError: JwkEs256kHasIncorrectLengthOfD: SECP256K1 JWK 'd' property must be 43 bytes.
    at Function.validateEs256kOperationKey ([...]\ion-tools\node_modules\@decentralized-identity\ion-sdk\dist\lib\InputValidator.js:38:19)
    at new LocalSigner ([...]\ion-tools\node_modules\@decentralized-identity\ion-sdk\dist\lib\LocalSigner.js:21:34)
    at Function.create ([...]\ion-tools\node_modules\@decentralized-identity\ion-sdk\dist\lib\LocalSigner.js:27:16)
    at ION.DID.generateRequest ([...]\ion-tools\ion.js\lib.js:171:59)

If you uncomment the highlighted lines,
const key43b = Buffer.from(Buffer.from(did._ops[0].update.privateJwk.d, "base64").toString("hex").padStart(64, '0'), "hex").toString("base64").slice(0,43);
did._ops[0].update.privateJwk.d = key43b; // <-- uncomment this line to see the "fix"

the update is generated and runs without an error. Probably not the best fix.

Questions:

Do you know what's the intention behind requiring the key to have a length of 43 here in ion-sdk? (when testing it locally, the underlying library was able to correctly sign messages with the short key w/o any hacky pre-processing)
If the length-check is needed security-wise, this should probably already happen when generating update and recovery keys so that a new one can be generated directly and users don't notice this error too late

The described bug does not only apply to d, but also to values x and y.

@thehenrytsai @decentralgabe perhaps you guys can comment/take a look at this?

Just from looking at the code of ion-sdk, I also assume that Ed25519 keys would fail completely right now.
One option to fix the bug mentioned above would be to retry here in generateKeyPair() if the key is invalid:
export async function generateKeyPair(
  type: KeyType = "secp256k1",
  options?: { maxRetries?: number }
): Promise<KeyPair> {
  const maxRetries = options?.maxRetries === undefined ? 3 : options.maxRetries;

  const keyGeneratorFn = keyGenerators[type];
  if (!keyGeneratorFn) {
    throw new Error("Unsupported key type");
  }

  const keyPair = await keyGeneratorFn();

  /**
   * as the key needs to be valid according to ion-sdk's InputValidator.validateEs256kOperationKey(),
   * we check this here and retry a few times if it did not work
   * (e.g., key could start with a null byte and is too short)
   */
  if (validateKeyPair(keyPair)) {
    return keyPair;
  } else {
    if (maxRetries === 0) {
      throw new Error("Failed to generate valid key");
    }
    return generateKeyPair(type, { maxRetries: maxRetries - 1 });
  }
}

function validateKeyPair(keyPair: KeyPair): Boolean {
  /**
   * ideally, we could call InputValidator.validateEs256kOperationKey() directly, but
   * unfortunately, it's not exported by @decentralized-identity/ion-sdk
   * -> but, we can indirectly call it via ion-sdk's LocalSigner and IonRequest
   *
   * based on types and validation logic, only secp256k1 keys are supported right now
   */
  try {
    // validate private key via LocalSigner (it calls the validation; would throw if invalid)
    LocalSigner.create(keyPair.privateJwk as any);
    // validate public key via IonRequest.createCreateRequest (calls validation; would throw if invalid)
    IonRequest.createCreateRequest({
      recoveryKey: keyPair.publicJwk as any,
      updateKey: keyPair.publicJwk as any,
      document: {},
    });
    return true;
  } catch (err) {
    return false;
  }
}

An even better fix might be if ion-sdk only returns valid keys (i.e. it checks the key using the InputValidator and creates new keys until a valid one is found - assuming that the 43 byte length requirement is required).
Still, both of these fixes do not address the fact that there might be "short" keys already in existing deployments that could still lead to this error in the future. For these, only a hacky workaround like above might do the trick. Or we remove the length check from ion-sdk if it is not required.


Allow reject(error)

Allow calling reject(error) being error an instance of Error. In that case, do this:
reject(503, error.toString());

Done in 2.0.3


Remove duplicate entry in airbnb.json

The entry also appears on line 37 (-> 36).

Thanks for the report/PR!


Update favicon and title for website

This is the problem right now

Title and favicon now have been set as follow:

This will be changed in the future when we have new favicon