[FOLLOWUP] fix: don't recreate base dir if it's already existed

What changes were proposed in this pull request?
optimize the base dir init logic, it now skips recreate base dir if it's already an dir
Why are the changes needed?
handles some corner cases such as the base dir is an mount point root path.
Does this PR introduce any user-facing change? rss shuffle server can use mounted path as base dir directly.
How was this patch tested?
Existing UTs.

Codecov Report

Merging #622 (bc7f285) into branch-0.7 (7f9b561) will increase coverage by 2.30%.
The diff coverage is 100.00%.

@@               Coverage Diff                @@
##             branch-0.7     #622      +/-   ##
================================================
+ Coverage         60.87%   63.17%   +2.30%
+ Complexity         1801     1797       -4
================================================
  Files               214      200      -14
  Lines             12387    10409    -1978
  Branches           1044     1041       -3
================================================
- Hits               7540     6576     -964
+ Misses             4443     3490     -953
+ Partials            404      343      -61

Impacted Files
Coverage Δ

...rg/apache/uniffle/storage/common/LocalStorage.java
51.31% <100.00%> (+2.25%)
:arrow_up:

...e/uniffle/server/storage/SingleStorageManager.java
70.58% <0.00%> (-2.95%)
:arrow_down:

deploy/kubernetes/operator/pkg/utils/rss.go

deploy/kubernetes/operator/pkg/webhook/manager.go

...y/kubernetes/operator/pkg/webhook/inspector/pod.go

...eploy/kubernetes/operator/pkg/utils/coordinator.go

...oy/kubernetes/operator/pkg/utils/shufflerserver.go

...oy/kubernetes/operator/pkg/controller/util/util.go

deploy/kubernetes/operator/pkg/utils/util.go

...bernetes/operator/pkg/controller/controller/rss.go

... and 7 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Custom Document Properties

I see the unit test that appears to grab custom document properties where both the name and value are known. In the sample code, there is material for creating custom properties.
How to loop through the custom document properties collection and grab both name and value dynamically?

I took code from the test sample page to create the following:
    private static bool HasCustomDocProperty(string path)
    {
        bool hasCustomProp = false;

        FileInfo file = new FileInfo(path);
        POIFSFileSystem fs = new POIFSFileSystem(file);
        HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);

        // Custom properties are part of the document info stream
        String dinfText = ext.DocumentSummaryInformationText;

        if(dinfText.IndexOf("ABCD") > -1)
        {
            hasCustomProp = true;
        }

        return hasCustomProp;
    }

    I am using this functionality in addition to SharpShell to work against Explorer.exe. When it reaches the following line of code:

                HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);

It just eats it. I placed breakpoints and it does not move beyond it.
Please advise.
Thanks


Upgrade to Iron 0.5

Hello, fantastic library, thanks for your hard work! Excuse the emboldening below, trying to ma
I'm currently trying to use lettre to send email from a rustless server, but the older version of iron depends on an old verison of cookie, which in turn depends on an old openssl meaning it's not possible to use the current stable version of lettre.
It's worth noting that in newer versions of hyper it appears the dependency on cookie has actually disappeared.
Output when trying to add lettre:
error: native library `openssl` is being linked to by more than one version of the same package, but it can only be linked once; try updating or pinning your dependencies to ensure that this package only shows up once

  openssl-sys v0.9.10
  openssl-sys v0.7.17

Sorry just realised this may not be the cause, closing this off for now while I do some more testing.


Error icon

Hey, i've got a little problem with the icon.

My Code:
import React from 'react';
import AlertContainer from 'react-alert';
export default class App extends React.Component {
  constructor(props){
  super(props);
this.alertOptions = {
offset: 10,
position: 'top',
theme: 'dark',
time: 5000,
      transition: 'scale'
  };
  }
  showAlert(){
    this.msg.info('Connected', {
    time: 5000,
  type: 'info',
 icon:
});
}
render(){
 return(

   <AlertContainer ref={a => this.msg = a} {...this.alertOptions} />
  <button onClick={this.showAlert.bind(this)}>Show Alert</button>

);
}
}
I cant find out the problem

you should save yourself and forget this project- it is unmaintained

Should be fixed with the v2 release. A lot of issues here are really old, as the project was unmaintained, so I will close all issues. Feel free to ask to open it again if the issue persist after v2 update.


Adding my awesome search box.

Type anything and search directly from Google.

Your pull request seems good, but must be checked by a human maintainer for the following reason(s):

The bot does not support marking the week2 challenge yet

Please be patient until a maintainer has time to look over your contribution.
This is an automated response, beep boop.
if you think there is a mistake, contact a maintainer

8615bb793f45b169f8331ed5b55e22cc677d5e9d


Requesting an update in the Wiki page: EnTT in Action

I am developing Spike, which is a game engine which can run on a toaster. It uses EnTT for ECS. Can I get the engine in Engines and the like list on the EnTT in Action wiki page? 😊
If yes, here is the mark-down ⬇
Spike: A powerful game engine which can run on a toaster

Updated. Thanks. 🙂


ClassLoaderResourceAccessor non-functional in Maven-like SetUp

Environment
Liquibase Version: 4.2.2
Liquibase Integration & Version: Maven
Description
I have a schema-file (XML) which I want to load using the Resource-Functionality, that means by classpath, so that JAR-compatiblity is ensured. After struggling with the ClassLoaderResourceAccessor for a while now, I believe it is currently non-functional in certain cases, as it refuses to find the schema-file while loading the resource using plain Java works.
I believe this might be an unintended side-effect of the attempt to remove absolute paths in 4.0.0, even if that error message is still used inflationary in the current implementation.
Details follow below:
Steps To Reproduce
In the example below, my schema-file is named my_schema.xml and is located in main/resources/dbschema, that is a subfolder of the Maven-managed resources folder.
The overall inconsistency can be demonstrated by actually asking the accessor about what is present in said subfolder:
    var accessor = new ClassLoaderResourceAccessor(Thread.currentThread().getContextClassLoader()); //just to be explicit

    //instead of an hard-coded access, let's ask the accessor what resources we have (and there is only one file in that folder):
    var set = accessor.list(null, "dbschema", true, true, true);
    if (set.size() != 1) throw new RuntimeException("TEST SETUP BROKEN!");
    var mySchemaFile = set.first(); //resolves to 'dbschema/my_schema.xml'

    return new Liquibase(mySchemaFile, accessor, db); //the file is not found *despite* reporting its presence

To date, I have not managed to load any of my resources using ClassLoaderResourceAccessor.
Note that variable db is not relevant, use any database you want.
Additional Context
The ClassLoaderResourceAccessor is functional for all the Liquibase-internal resources, hence an ugly workaround, inspired by the Mock-Accessor, is successful:
var stream = getClass().getResourceAsStream("/dbschema/my_schema.xml"); //note the use of an absolute path here
var reader = new BufferedReader(new InputStreamReader(stream));
var content = reader.lines().collect(Collectors.joining());
reader.close();
return new Liquibase( LiquibaseSchemaContentInjector.MAGIC_STR, new LiquibaseSchemaContentInjector( content ), db);

//(...)

/** Acts like a {@link liquibase.resource.ClassLoaderResourceAccessor} but injects a custom Schema if asked for one. */
public class LiquibaseSchemaContentInjector extends AbstractResourceAccessor {

    public static String MAGIC_STR = "my_schema.xml";
    private final byte[] changeLog;
    private final AbstractResourceAccessor forwardTo;

    public LiquibaseSchemaContentInjector( String changelogContent ){
        try {
            changeLog = changelogContent.getBytes(LiquibaseConfiguration.getInstance().getConfiguration(GlobalConfiguration.class).getOutputEncoding());
        } catch (Exception e){
            throw new RuntimeException(e);
        }
        forwardTo= new ClassLoaderResourceAccessor();
    }

    @Override
    public InputStreamList openStreams(String relativeTo, String streamPath) throws IOException {
        if (streamPath.equals(MAGIC_STR)) {
            InputStream stream = new ByteArrayInputStream(changeLog);
            InputStreamList list = new InputStreamList();
            list.add(URI.create(streamPath), stream);
            return list;
        } else return forwardTo.openStreams(relativeTo, streamPath);
    }

    //the other methods just "forward" as well
}

Hi @EliasHeydrich Thanks for your explanation of the problem.  We have just made a bunch of adjustments to loading of files in 4.3.1 and will be adding one additional fix in 4.3.2.  Please try that and see if it resolves your issue.  Can you also update the version of Liquibase that you found this.  I think there may be a typo in the version in the description section.  (4.4.2)

You are correct, I had a typo in the version.
I was using 4.2.2, however I can now confirm that the issue is still reproducable with 4.3.1 using the method above.

This issue got stale. Closing it for now. You are welcome to reopen it you still have the same issue. Thanks!

I've encountered the same issue while working on a Maven project, specifically when attempting to use an XML changelog file situated at the root of the classpath. Although the resource accessor successfully lists the file, it is subsequently reported as "not found."
Liquibase liquibase = new Liquibase("someChangelogFile.xml", new ClassLoaderResourceAccessor(Thread.currentThread().getContextClassLoader()), database);
liquibase.update("test");

Upon debugging, I was able to trace the problem back to these lines inside the parseToNode method of the XMLChangeLogSAXParser class:
LiquibaseEntityResolver resolver = new LiquibaseEntityResolver(this);
resolver.useResoureAccessor(resourceAccessor, FilenameUtils.getFullPath(physicalChangeLogLocation));

I performed testing across the following versions, all of which exhibited the same behavior:
4.22.0
4.17.2
4.16.0
4.2.2
3.8.6


function min(pg_lsn) does not exist

after commit 7d1b6ba8772b543af97d73aef4f8f95affa5de8b
versions 12 has error
WARNING:  "PoWA".powa_take_snapshot(0): function "PoWA".powa_replication_slots_aggregate failed:
 	              state  : 42883
 	              message: function min(pg_lsn) does not exist
 	              detail :
 	              hint   : No function matches the given name and argument types. You might need to add explicit type casts.
 	              context: PL/pgSQL function "PoWA".powa_replication_slots_aggregate(integer) line 12 at SQL statement
 	SQL statement "SELECT "PoWA".powa_replication_slots_aggregate(0)"
 	PL/pgSQL function "PoWA".powa_take_snapshot(integer) line 128 at EXECUTE

versions 10 and 11 have error
WARNING:  "PoWA".powa_take_snapshot(0): function "PoWA".powa_stat_database_snapshot failed:
 	              state  : 42804
 	              message: structure of query does not match function result type
 	              detail : Returned type integer does not match expected type bigint in column 17.

versions 6.5 and 9.6 have error
 WARNING:  "PoWA".powa_take_snapshot(0): function "PoWA".powa_stat_archiver_snapshot failed:
 	              state  : 42883
 	              message: function pg_last_wal_receive_lsn() does not exist
 	              detail :
 	              hint   : No function matches the given name and argument types. You might need to add explicit type casts.
 	              context: PL/pgSQL function "PoWA".powa_stat_archiver_src(integer) line 14 at assignment

Hi,
Yes I saw that yesterday when I merged the v5.  I already fixed it this morning (https://github.com/powa-team/powa-archivist/pull/63) and also fixed pg11 compatibility (https://github.com/powa-team/powa-archivist/pull/64).

I still have work to do for earlier versions I think, and probably for pg 17 too.  I will take care of it this weekend or next weekend.

thank you, versions 10 - 12 are fixed, but 9.5 and 9.6 still have errors

yes, and 9.4 has a different error too. as I said I'm working on it and it will all be fixed before the beta

out of curiosity do you still have 9.6 and older version in production?

out of curiosity do you still have 9.6 and older version in production?

no, with powa only 14+

ok!
a fix for EOLed version probably isn't top emergency then.

not it works, thanx

sorry, I didn't update this issue as pg 9.4 is still broken. I think I will just remove support for this major version though, there are just too many problems (doesn't know about the standard => named parameter, no ASSERT support in plpgsql and no function to get the list of created objects in an event trigger).

typo: I meant NOW it works on 9.5 and 9.6


Vikunja install error

Please verify that you have read and understood the guidelines.
yes
A clear and concise description of the issue.
Vikunja install fails with below error. No additional information if running advanced mode with verbose logging.
What settings are you currently utilizing?
Default Settings
Which Linux distribution are you employing?
Debian 12
If relevant, including screenshots or a code block can be helpful in clarifying the issue.
Creating a Vikunja LXC using the above default settings
 ✓ Using local for Template Storage.
 ✓ Using local-lvm for Container Storage.
 ✓ Updated LXC Template List
 \unable to create CT 109 - command 'lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar xpf - --zstd --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' -C /var/lib/lxc/109/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 2
 |bash: line 182: exit: A problem occured while trying to create container.: numeric argument required

Please provide detailed steps to reproduce the issue.
Attempt default install by pasting bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/vikunja.sh)" into shell.

Thats not an vikunja issue, the script failed, because there are some problems on your proxmox node with the container id or something else.
Reboot your Proxmox and test again

Rebooting didn't help but I am seeing the same error trying a different script. Any advice on how to debug this?

Which version of Proxmox VE? With which user do you run the script? Do you run the script in Main-Node?
nano /etc/subuid
nano /etc/subgid
Whats the output?

Got it fixed. There was a leftover folder in /var/lib/lxc with incorrect permissions that matched the new id I was trying to use. Deleting that folder and allowing it to be recreated worked. Thanks for the help.


[Chore] update docs to address issue #54

This Pr is to address concerns raised in;
https://github.com/valory-xyz/open-aea/issues/54

Added HTTP demo
Added in Apply environment demo
Added in vscode launch.json

Codecov Report

Merging #69 (9fa17d8) into main (1317a59) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #69   +/-   ##
=======================================
  Coverage   97.11%   97.11%
=======================================
  Files         315      315
  Lines       25156    25156
=======================================
  Hits        24429    24429
  Misses        727      727

Flag
Coverage Δ

unittests
97.11% <ø> (ø)

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

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 1317a59...9fa17d8. Read the comment docs.


Add serializable type for encrypted secrets

Ref: https://github.com/leonard-thieu/toofz-necrodancer-leaderboards-services/pull/8

Codecov Report

Merging #17 into master will increase coverage by 1.62%.
The diff coverage is 94.8%.

@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
+ Coverage      90%   91.62%   +1.62%
==========================================
  Files          13       16       +3
  Lines         150      227      +77
  Branches       24       32       +8
==========================================
+ Hits          135      208      +73
- Misses          5        7       +2
- Partials       10       12       +2

Impacted Files
Coverage Δ

toofz/Secrets.cs
100% <100%> (ø)

toofz/EncryptedSecret.cs
89.47% <89.47%> (ø)

toofz/EncryptedSecretConverter.cs
89.47% <89.47%> (ø)

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 85b4182...905c0ce. Read the comment docs.


Add prefix sum constraints

This change is

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.12%. Comparing base (a253a49) to head (2606c6c).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #737      +/-   ##
==========================================
+ Coverage   93.08%   93.12%   +0.03%
==========================================
  Files          84       84
  Lines       11125    11136      +11
  Branches    11125    11136      +11
==========================================
+ Hits        10356    10370      +14
+ Misses        676      673       -3
  Partials       93       93

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


[WIP] BIP155 getaddrv2 and addrv2

Since September 15th Tor started warning onion service operators that v2 is deprecated. In part because of that Bitcoin Core has merged PR 19954 that implements BIP155 addrv2 message. The new p2p messages allow share nodes' endpoints other than ip:port (onion v3, I2P, etc).
Currently Wasabi connects to third-party nodes through v2 onion services only because v2 addresses can be encoded as IPv6 addresses (onioncat) what makes the connection transparent because it is the tor client the one that knows how to solve the real onion address.
After onion services v2 are completely removed Wasabi will not be able to connect to third-party nodes any more.
This PR includes some WIP code that:

adds getaddrv2 and addrv2 p2p messages.
adds SHA3 digest (the NBitcoin.Altcoins contains an implementation but moving that it is a big change)
adds code to keep backward compatibility.

Problems
The p2p code in NBitcoin uses IPEndpoint in many places and it seems we have to use the NetworkAddress instead and also know when it needs to use a proxy.
Any commment, suggestion, clue or whatever that could help me to implement this is very much welcome.

@lontivero In Wasabi we're using EndPoint
 for local Bitcoin Core P2P connections: IIRC people were pasting onion addresses there and report it still works.
For backend connection we're using Uri.
Anyway if your solution works, then whatever I just wanted to note this.

@nopara73 In NBitcoin we use Endpoint as well and TryParseEndpoint to parse it. (which support onion already)

@lontivero You should be able to make it ready for review (non-draft) since https://github.com/MetacoSA/NBitcoin/pull/944 is merged, right?

Yes. I am trying to make it no so big. Also, sipa changed bitcoin core (it is not merged yet) making this PR incompatible, this means that I cannot use the rc2 to test this, I need to compile core and use that.

@nopara73 @NicolasDorier this is ready for review (the failing test is failing for some unrelated reason).
After this PR I need to make a few small changes like signaling sendaddrv2 before VerAck message (this changes the order of the handshake messages), clean up a few duplicated code, increase the protocol version to 70016 and make sure Tor addresses are routed through Tor (I didn't check it).

Please do not change types around, that's too much breaking changes.
Keep NetworkAddress, I don't understand what Service is.
You can modify NetworkAddress to support your changes.
Do not change the IPEndpoint stuff in Node class. Keep the current behavior for what is not Torv3, if it is Torv3 then just throw an exception like InvalidOperationException.

Copied. I will implement everything in NetworkAddress then and avoid changes in Node. I am closing this PR and I will open other/s.


[BUG]: insert().values().execute() returns different value between planetscale mysql2

What version of drizzle-orm are you using?
0.27.0
What version of drizzle-kit are you using?
No response
Describe the Bug
The following code:
const result = await database
            .insert(table)
            .values({ ... })
            .execute();

returns different result between drizzle-orm/mysql2 and drizzle-orm/planetscale-serverless.
With drizzle-orm/mysql2, result is an array and doesn't match the typescript definition:
[
      ResultSetHeader {
        fieldCount: 0,
        affectedRows: 1,
        insertId: 1110,
        info: '',
        serverStatus: 3,
        warningStatus: 0
      },
      undefined
]

When using drizzle-orm/planetscale-serverless, accesing result.insertId works directly.
Expected behavior
Both should return the same thing, probably ExecutedQuery or ResultSetHeader
Environment & setup
No response

on insert, we are returning the same object that is returned from a driver. As long as mysql2 is different from database-js it will have a different API for insert/update/delete data returned
But I agree that we need to unify those and return them all in 1 format. I'll mark this issue as improvement

This certainly tripped me up! Was also struggling to figure out why insertId is typed as a string. Some small tweaks seem like they'd make drizzle + planetscale a bit more ergonomic.
Maybe I'll take a crack at it at some point if there is still interest, once I get frustrated enough with Number(insert.insertId)
I also found it interesting that only AUTO_INCREMENT is supported. Not sure if that is the same behaviour as the other drivers or not


Reqest example of using multiform post call for begginers.

I'm a rust newbie so I'm having problems figuring out how to populate a multipart form.
_....
client.url(&uri).unwrap();
let mut form = Form::new();
<how to add a the data so it's a key:value pair>
client.httppost(form).unwrap();_
I've tried form.part("loggingin").add(); but nothing is being added to the form.
https://docs.rs/curl/0.4.44/curl/easy/struct.Easy2.html#method.httppost points me to https://docs.rs/curl/0.4.44/curl/easy/struct.Form.html and then I hit the wall in confusion.
I suspect adding a simple example to the examples directory would be all most people need for a guide. Just something with a key of "Foo" and a value of "Bar" is all I'm after. Like the header example, but that uses List, not Form.
Looking at the tests directory I tried:
form.part("loggingin").contents(b"Yup.").add();
But it doesn't look like it's done anything as
println!("Form {:#?}", form);
returns
Form Form {
fields: "...",
}

Generally speaking the official libcurl examples are useful for learning how to use libcurl, and since curl-rust is just a fairly thin wrapper around libcurl most of the examples should translate from C to Rust to some degree. If you are a beginner, then curl-rust is definitely not the easiest HTTP client to get started with (unless you are already familiar with libcurl).
For your specific questions, this is indeed the correct syntax:
// Make a new form
let mut form = Form::new();

form.part("field1") // define a field named `field1`
    .contents(b"foo") // with a value
    .add().unwrap(); // and finish adding the key-value pair to the form

// Use the form in the request
easy.httppost(form).unwrap();

But it doesn't look like it's done anything as
println!("Form {:#?}", form);
returns
Form Form {
fields: "...",
}

I would not rely on the Debug implementation to provide very much useful information, especially with structs that are wrapping foreign C types. You'd have to send the request and verify whether it works.


Where should be the generated controllers?

I can't see them on the Controllers folder and I don't see any folder on vendor name "TCG" - Am I doing something wrong or this files would be always hidden?

@BrunoMCTeixeira
the best way is to use the composer composer require tcg/voyager (the best choice)
(Or clone it and add TCG folder inside vendor folder).
you'll find Controller then in this path /vendor/tcg/voyager/src/Http/Controllers
and anything is insinde vendor/tcg/voyager path

Try to run on CLI this: php artisan voyager:controllers then you can see voyager controllers in Http/Controllers/Voyager which are the clones of vendor and you can hook your own scripts.
If you generated a new database with model you can run this: php artisan make:controller WhateversController --model=Whatever --resource Laravel will generate controller based on your generated Model...

@tzs007, please don't recommend artisan voyager:controllers except to override ALL controllers.  Individual controllers can be overridden by changing the controller field in the BREAD.
@BrunoMCTeixeira, Voyager doesn't generate controllers.  Routes created by Voyager's BREAD are handled by Voyager's VoyagerBreadController.  If you need custom functionality, you can subclass that Controller class and change the controller setting within the BREAD configuration.


Deafault Admin user shown as "unknown" in project/cluster member list for project members.

Rancher versions:v2.0.8-rc2
Steps to Reproduce:
Create a setup with 1 cluster.
Enabled AD auth.
Add an AD user as member to existing "Default" project in the cluster.
Log in as this user.
Access "Default" project and get to member list page.
Notice that the Admin user shows up as "Unknown"

Querying for admin user results in "Forbidden" error:
{
"baseType": "error",
"code": "Forbidden",
"message": "users.management.cattle.io \"user-fvkgn\" is forbidden: User \"u-qxd6dri3v2\" cannot get users.management.cattle.io at the cluster scope",
"status": 403,
"type": "error"
}

Note - "New user default" is set to "user" ( Default settings" in this case)

Tested with Rancher versions:v2.0.8-rc3
This issue is not seen anymore.
userPrincipalId field get populated in clusterRoleTemplateBindings and in projectRoleTemplateBindings for Default admin users like "userPrincipalId": "local://user-kg69m",


USB Connectivity Issues on Windows (Sense 2)

Howdy! I'm trying to sideload an app onto my Sense 2 using this method but running into issues with USB connectivity; I attempted to change the driver type through  USBDriverTool  to no avail, upon checking hosts my device list is empty for all driver types. Are there any workarounds / other necessary steps required that y'all know of? I am on Windows 10 so I used the equivalent environmental variable commands
$env:FITBIT_QA_COMMANDS = "1"
$env:FITBIT_DEVBRIDGE_DUMP = "1"

which may be another root of the issue.

@lardahle  Did you get anywhere on this issue? I seem to be in the same boat


feat: separate routing and navigation for admins and end-users

Description:
Short summary:
Rework navigation to separate the navigation options between 2 groups of users: Admin and End-users.
Current issue:

Need to add more tests to increase coverage
Need to incorporate user type checking using roles (via API)

Checklist:

[ ] Related tests were updated
[ ] Related documentation was updated

This is a draft. Asking for comments.


feat(controller): replace failed node

Fixes #1082
@AlCalzone Im't stucked now on the controller function :thinking:
How do I get the node? How can I specify if I want to replace the node in secure mode or not? Is the inclusion started automatically?

From the specs I'm assuming that the ZW_FAILED_NODE_REPLACE status means that the controller is in inclusion mode now. I would expect the controller to send us AddNodeToNetwork requests. The inclusion is handled in packages\zwave-js\src\lib\controller\Controller.ts, line 747ff. If the new node is added like I am guessin, you can directly reuse that code for replacing the node. You might have to reuse _beginInclusionPromise and _includeNonSecure for the replacement process too.

@AlCalzone Something like this?

@AlCalzone Like this?

This looks like it could work with my changes. We need to test if the success of the replace promise needs to depend on the inclusion promise or if we always get a success/failure report back.

@AlCalzone
z2m:App Zwave api call: replaceFailedNode [ 2, false ] +28s
14:03:11.736 CNTRLR   starting replace failed node process...
14:03:11.739 DRIVER   Send queue:                                                        (1 message)
                      · [REQ] ReplaceFailedNode
14:03:11.741 SERIAL » 0x0105006302019a                                                     (7 bytes)
14:03:11.741 DRIVER » [REQ] [ReplaceFailedNode]
                        payload: 0x0201
14:03:11.742 DRIVER   send thread state: sending.execute
  z2m:Mqtt MQTT client reconnecting +26s
14:03:37.373 SERIAL « [ACK]                                                                   (0x06)
14:03:37.375 DRIVER   send thread state: sending.execute
14:03:37.376 SERIAL « 0x010401630891                                                       (6 bytes)
14:03:37.377 SERIAL » [ACK]                                                                   (0x06)
14:03:37.379 DRIVER « [RES] [ReplaceFailedNode]
                        payload: 0x08
14:03:37.382 CNTRLR   No response from controller after 1/3 attempts. Scheduling next try in 100 ms.
14:03:37.383 DRIVER   send thread state: sending.execute
  z2m:Mqtt Connection refused: Not authorized +14ms
  z2m:Mqtt MQTT client closed +2ms
14:03:37.483 SERIAL » 0x0105006302019a                                                     (7 bytes)
14:03:37.484 DRIVER » [REQ] [ReplaceFailedNode]
                        payload: 0x0201
14:03:37.486 SERIAL « [ACK]                                                                   (0x06)
14:03:37.487 DRIVER   send thread state: sending.execute
14:03:37.488 SERIAL « 0x010401630891                                                       (6 bytes)
14:03:37.489 SERIAL » [ACK]                                                                   (0x06)
14:03:37.490 DRIVER « [RES] [ReplaceFailedNode]
                        payload: 0x08
14:03:37.491 CNTRLR   No response from controller after 2/3 attempts. Scheduling next try in 1100 ms
                      .
14:03:37.492 DRIVER   send thread state: sending.execute
14:03:38.595 SERIAL » 0x0105006302019a                                                     (7 bytes)
14:03:38.597 DRIVER » [REQ] [ReplaceFailedNode]
                        payload: 0x0201
14:03:38.603 SERIAL « [ACK]                                                                   (0x06)
14:03:38.607 DRIVER   send thread state: sending.execute
14:03:38.610 SERIAL « 0x010401630891                                                       (6 bytes)
14:03:38.611 SERIAL » [ACK]                                                                   (0x06)
14:03:38.616 DRIVER « [RES] [ReplaceFailedNode]
                        payload: 0x08
14:03:38.623 DRIVER   send thread state: sending.execute
14:03:38.627 DRIVER   Send queue: (empty)                                               (0 messages)
14:03:38.628 DRIVER   send thread state: idle

14:03:37.382 CNTRLR   No response from controller after 1/3 attempts.

Weird - it did receive the response. Did you forget the @expectedResponse before creating the log?

Did you forget the @expectedResponse before creating the log?

What?

Did you forget the @expectedResponse before creating the log?

What?

That:

Did you have that in place before creating the log?

@AlCalzone Sure. Actually I have the repo linked in zwavejs2mqtt, when I make some changes I run npm run build and relunch zwavejs2mqtt.

when I make some changes I run npm run build

You could also keep npm run watch running, so your sources are automatically compiled on change.

You could also keep npm run watch running, so your sources are automatically compiled on change.

Didn't saw that, nice to know :) What about the error? I'm stucked :(

I'm not sure without debugging myself. For some reason the response is not detected as the expected one.
You could set a conditional breakpoint (this instanceof ReplaceFailedNodeRequest) in https://github.com/zwave-js/node-zwave-js/blob/4dffb8de6796723604da87e26cc8f8bf8ab0b434/packages/zwave-js/src/lib/message/Message.ts#L318 and see if you find the problem. If not, I can check later.

You could set a conditional breakpoint (this instanceof ReplaceFailedNodeRequest) in

In fact I receive that respone, didn't know the flow now but maybe I forgot some reference somewhere?

@AlCalzone I haven't been able to find what's going on, as you said I see the response coming but I dunno why it's not 'catched', will let you debug this if you have time, will be back on monday otherwise

@robertsLando you should be good to go:
08:55:31.486 CNTRLR   starting replace failed node process...
08:55:31.488 DRIVER   send thread state: sending.execute
08:55:33.289 DRIVER « [REQ] [SendData]
                        callback id:     1
                        transmit status: NoAck
08:55:33.291 DRIVER   send thread state: sending.execute
08:55:33.293 DRIVER » [REQ] [ReplaceFailedNode]
                        payload: 0x1102
08:55:33.293 DRIVER   send thread state: sending.execute
08:55:33.294 CNTRLR   [Node 012] The node did not respond after 1 attempts.
                      It is probably asleep, moving its messages to the wakeup queue.
08:55:33.294 CNTRLR   [Node 012] The node is asleep.
08:55:33.295 DRIVER   send thread state: sending.execute
08:55:33.295 CNTRLR   [Node 012] ping failed: Failed to send the command after 1 attempts (Status No
                      Ack)
08:55:33.296 CNTRLR » [Node 012] querying node info...
08:55:33.297 DRIVER   send thread state: sending.execute
08:55:33.298 DRIVER   send thread state: sending.execute
08:55:33.299 DRIVER « [RES] [ReplaceFailedNode]
                        payload: 0x10
08:55:33.300 CNTRLR   The controller response indicated failure after 1/3 attempts. Scheduling next
                      try in 100 ms.
08:55:33.301 DRIVER   send thread state: sending.execute
08:55:33.416 DRIVER » [REQ] [ReplaceFailedNode]
                        payload: 0x1102
08:55:33.418 DRIVER   send thread state: sending.execute
08:55:33.420 DRIVER « [RES] [ReplaceFailedNode]
                        payload: 0x10
08:55:33.421 CNTRLR   The controller response indicated failure after 2/3 attempts. Scheduling next
                      try in 1100 ms.
08:55:33.421 DRIVER   send thread state: sending.execute
08:55:34.534 DRIVER » [REQ] [ReplaceFailedNode]
                        payload: 0x1102
08:55:34.537 DRIVER   send thread state: sending.execute
08:55:34.539 DRIVER « [RES] [ReplaceFailedNode]
                        payload: 0x10
08:55:34.541 DRIVER   send thread state: sending.execute
08:55:34.545 DRIVER » [Node 017] [REQ] [SendData]
                      │ transmit options: 0x25
                      │ callback id:      3
                      └─[NoOperationCC]
08:55:34.545 DRIVER   send thread state: sending.execute
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(). The promise rejected with the reason:
ZWaveError: The node replace process could not be started due to the following reasons:
· The node replace process is currently busy

@AlCalzone Will try this on Monday, thanks! 🙏🏻  I'm using z2m to test, I suggest you to give it a try especially for testing it's faster then write examples files :)

I have a test job ready I can modify and start with F5 without compiling first.

@AlCalzone I have tested this, but it has some strange behaviour... Could you give this a try? Actually it's replacing the node but the status report is not correct, I receive 3 (failed) and then if I press the inclusion button on the device it is included (but the inclusion isn't started :confused: )

@AlCalzone I think we are almost done here, something is missing:
13:53:33.474 DRIVER   handling request ReplaceFailedNode (99)
13:53:33.475 DRIVER     1 handler registered!
13:53:33.475 DRIVER     invoking handler #0
13:53:33.475 CNTRLR   handling replace node request (status = FailedNodeReplace)
13:53:40.180 CNTRLR   inclusion started, node is ready to be replaced
13:53:44.704 DRIVER       the message was handled
13:53:44.705 DRIVER   send thread state: idle
  z2m:Mqtt MQTT client reconnecting +14s
  z2m:App New connection nsck_h537JlSJb1DAAAB +11s
  z2m:Mqtt Connection refused: Not authorized +6ms
  z2m:App User disconnected fuy-s0owa4BxOL2CAAAA +9ms
  z2m:Mqtt MQTT client closed +4ms
  z2m:Mqtt MQTT client reconnecting +3s
  z2m:Mqtt Connection refused: Not authorized +2ms
  z2m:Mqtt MQTT client closed +1ms
  z2m:Mqtt MQTT client reconnecting +3s
  z2m:Mqtt Connection refused: Not authorized +2ms
  z2m:Mqtt MQTT client closed +1ms
13:53:53.329 SERIAL « 0x0105006303049e                                                     (7 bytes)
13:53:53.330 SERIAL » [ACK]                                                                   (0x06)
13:53:53.331 DRIVER « [REQ] [ReplaceFailedNode]
                        payload: 0x0304
13:53:53.332 DRIVER   Send queue: (empty)                                               (0 messages)
13:53:53.332 DRIVER   send thread state: idle
13:53:53.333 DRIVER   Send queue: (empty)                                               (0 messages)
13:53:53.334 DRIVER   handling request ReplaceFailedNode (99)
13:53:53.334 DRIVER     1 handler registered!
13:53:53.334 DRIVER     invoking handler #0
13:53:53.335 CNTRLR   handling replace node request (status = FailedNodeReplaceDone)
13:54:00.483 CNTRLR   node successfully replaced
13:54:00.484 DRIVER       the message was handled
13:54:00.484 DRIVER   send thread state: idle
  z2m:Mqtt MQTT client reconnecting +10s
  z2m:Mqtt Connection refused: Not authorized +3ms
  z2m:Mqtt MQTT client closed +1ms
13:54:03.306 CNTRLR   stopping inclusion process...
13:54:03.307 DRIVER   Send queue:                                                        (1 message)
                      · [REQ] AddNodeToNetwork
13:54:03.310 SERIAL » 0x0105004ac50471                                                     (7 bytes)
13:54:03.311 DRIVER » [REQ] [AddNodeToNetwork]
                        payload: 0xc504
13:54:03.312 DRIVER   send thread state: sending.execute
13:54:03.314 SERIAL « [ACK]                                                                   (0x06)
13:54:03.315 DRIVER   send thread state: sending.execute
13:54:03.316 DRIVER   Send queue: (empty)                                               (0 messages)
13:54:03.316 DRIVER   send thread state: idle

As you can see in the last part a AddNodeToNetwork request is sent but the addNodeToNetwork handler isn't called, if I restart the controller the node is correctly added to the replaced id, I think I should send a NIF or something else when the replace is done?

13:53:53.334 DRIVER   handling request ReplaceFailedNode (99)
13:53:53.334 DRIVER     1 handler registered!
13:53:53.334 DRIVER     invoking handler #0
13:53:53.335 CNTRLR   handling replace node request (status = FailedNodeReplaceDone)
13:54:00.483 CNTRLR   node successfully replaced
13:54:00.484 DRIVER       the message was handled
13:54:03.306 CNTRLR   stopping inclusion process...
13:54:03.307 DRIVER   Send queue:                                                        (1 message)
                      · [REQ] AddNodeToNetwork
13:54:03.310 SERIAL » 0x0105004ac50471                                                     (7 bytes)
13:54:03.311 DRIVER » [REQ] [AddNodeToNetwork]
                        payload: 0xc504
13:54:03.314 SERIAL « [ACK]                                                                   (0x06)

I think we're almost there. The AddNodeToNetwork request is for stopping the inclusion process which doesn't seem to be necessary in this case.
Seems we need to react to the FailedNodeReplaceDone request and bootstrap the new node, essentially perform the secure inclusion and re-interview it, probably also emit a node removed and node added event.
I find it weird that there is no information about the new node (NIF, is it slave or controller?) sent to the application like it happens on a normal inclusion.

Seems we need to react to the FailedNodeReplaceDone request and bootstrap the new node, essentially perform the secure inclusion and re-interview it, probably also emit a node removed and node added event.
I find it weird that there is no information about the new node (NIF, is it slave or controller?) sent to the application like it happens on a normal inclusion.

No idea what to do :rofl:

No idea what to do

I would propose:
Emit "node removed", destroy old node instance
https://github.com/zwave-js/node-zwave-js/blob/master/packages/zwave-js/src/lib/controller/Controller.ts#L752-L754
Create the new node instance (we don't receive the NIF, so we don't know the device classes etc. yet, you can leave them out) and remember it.
Request the node's protocol info from the controller (I'm assuming it has it)
Then (again, I'm assuming we can do this - the docs are a bit sparse here) perform the secure bootstrapping:
https://github.com/zwave-js/node-zwave-js/blob/master/packages/zwave-js/src/lib/controller/Controller.ts#L786-L884
Emitting the node added event will cause the driver to interview it.

Create the new node instance (we don't receive the NIF, so we don't know the device classes etc. yet, you can leave them out) and remember it.

I also don't have the nodeId in the status report context, I should someway add it too...

Request the node's protocol info from the controller (I'm assuming it has it)

Is there an api on controller for this? Cannot find it

https://github.com/zwave-js/node-zwave-js/blob/master/packages/zwave-js/src/lib/controller/Controller.ts#L786-L884

Seems this will become a function so, or should I copy and paste it?

I've played with this a bit:
11:17:33.668 CNTRLR   starting replace failed node process...
11:17:33.671 DRIVER   Send queue:                                                       (2 messages)
                      · [REQ] ReplaceFailedNode
                      · [REQ] SendData (MultiChannelCCEndPointGet) [Node 17, asleep]
11:17:33.673 SERIAL » 0x0105006311028a                                                     (7 bytes)
11:17:33.674 DRIVER » [REQ] [ReplaceFailedNode]
                        payload: 0x1102
11:17:33.676 SERIAL « [ACK]                                                                   (0x06)
11:17:33.684 SERIAL « 0x010401630099                                                       (6 bytes)
11:17:33.684 SERIAL » [ACK]                                                                   (0x06)
11:17:33.685 DRIVER « [RES] [ReplaceFailedNode]
                        payload: 0x00
11:17:33.687 DRIVER   Send queue:                                                        (1 message)
                      · [REQ] SendData (MultiChannelCCEndPointGet) [Node 17, asleep]
11:17:33.802 SERIAL « 0x01050063020398                                                     (7 bytes)
11:17:33.803 SERIAL » [ACK]                                                                   (0x06)
11:17:33.804 DRIVER « [REQ] [ReplaceFailedNode]
                        payload: 0x0203
11:17:33.805 DRIVER   Send queue:                                                        (1 message)
                      · [REQ] SendData (MultiChannelCCEndPointGet) [Node 17, asleep]
11:17:33.806 DRIVER   Send queue:                                                        (1 message)
                      · [REQ] SendData (MultiChannelCCEndPointGet) [Node 17, asleep]
11:17:33.807 DRIVER   handling request ReplaceFailedNode (99)
11:17:33.807 DRIVER     1 handler registered!
11:17:33.808 DRIVER     invoking handler #0
11:17:33.808 CNTRLR   handling replace node request (status = FailedNodeReplace)
11:17:33.809 CNTRLR   inclusion started, node is ready to be replaced
11:17:33.809 DRIVER       the message was handled
11:17:38.693 SERIAL « 0x0105006302049f                                                     (7 bytes)
11:17:38.694 SERIAL » [ACK]                                                                   (0x06)
11:17:38.695 DRIVER « [REQ] [ReplaceFailedNode]
                        payload: 0x0204
11:17:38.696 DRIVER   Send queue:                                                        (1 message)
                      · [REQ] SendData (MultiChannelCCEndPointGet) [Node 17, asleep]
11:17:38.697 DRIVER   Send queue:                                                        (1 message)
                      · [REQ] SendData (MultiChannelCCEndPointGet) [Node 17, asleep]
11:17:38.698 DRIVER   handling request ReplaceFailedNode (99)
11:17:38.698 DRIVER     1 handler registered!
11:17:38.699 DRIVER     invoking handler #0
11:17:38.699 CNTRLR   handling replace node request (status = FailedNodeReplaceDone)
11:17:38.699 CNTRLR   node successfully replaced
11:17:38.700 DRIVER       the message was handled

I had to change the check in replaceFailedNode to make it not crash on success.
The node was not included securely, but you don't have refactored that part yet, so that is expected.
Also you can see that the pending messages are not discarded because the old node instance is not removed.
What is missing:

[ ] Remove the old node instance on FailedNodeReplaceDone
[ ] Try and see if we can perform secure bootstrapping
[ ] Emit node added afterwards to kick off the interview.

@AlCalzone Seems working :tada:

@AlCalzone This should be ready now

Great, I'll check this out later and try myself


rpmbuild fails if license is not set in Cargo.toml

Error:
     Running cargo build --release
    Finished release [optimized] target(s) in 0.03s
    Creating release archive: change-password-0.1.0.tar.gz
    Building change-password-0.1.0.rpm (using rpmbuild 4.11.3)
     Running /usr/bin/rpmbuild -D _topdir /home/das/genomedk-infra/system-tools/change-password/target/release/rpmbuild -D _tmppath /home/das/genomedk-infra/system-tools/change-password/target/release/rpmbuild/tmp -ba SPECS/change-password.spec
error: License field must be present in package: (main package)
error: error running /usr/bin/rpmbuild (exit status: exit code: 1)

Maybe cargo rpm init should warn that a license is required, if not already set in Cargo.toml.

Seems like a good case for an error


pub finished with exit code 1

The output is:
Preparing lint_staged.
Running tasks for staged files.
Reverting to original state because of errors...
pub finished with exit code 1
husky
- pre-commit hook exited with code 1 (error)

The git status output is:
On branch xxxx
Your branch is behind 'origin/xxxx' by xx commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

All conflicts fixed but you are still merging.
  (use "git commit" to conclude merge)

Changes to be committed:
	modified:   .husky/pre-commit
	modified:   lib/app.dart
	modified:   lib/main.dart
	modified:   pubspec.lock
	modified:   pubspec.yaml

The .husky/pre-commit content is:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

flutter pub run lint_staged

The configuration for lint_staged in pubspec.yaml is:
lint_staged:
  .dart: dart fix --apply

The flutter doctor output is:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.3, on macOS 12.2.1 21D62 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.75.1)
[✓] Connected device (1 available)
[✓] HTTP Host Availability

• No issues found!

According to the output, some errors is thrown during running dart fix --apply lib/app.dart and dart fix --apply lib/main.dart

Running dart fix --apply lib/app.dart output:
Directory doesn't exist: lib/app.dart

Usage: dart fix [arguments]
-h, --help       Print this usage information.
-n, --dry-run    Preview the proposed changes but make no changes.
    --apply      Apply the proposed changes.

Run "dart help" to see global options.

Related to https://github.com/dart-lang/sdk/issues/43892

Find that dart fix --apply for single file is supported since 2.18.0 https://github.com/dart-lang/sdk/commit/467a1b05c03878fa9f94779a3af18dcf368254da

This can be fixed with https://github.com/hyiso/lint_staged/commit/84aaa60eda6215b4cb08e019886156bcfc8c564e
Now change lint_staged configuration in pubspec.yaml to
lint_staged:
  .dart: dart fix --apply <file>/../

lint_staged will lint the parent path for this file.


Allow adding new keys from tree view

From the tree view, it is possible to edit translations, rename keys and delete keys. But it isn't possible to add new keys from there. It would be great if it was possible to add new keys from the tree view.
Duplicating existing keys here would also be a great feature. As i often see myself duplicating existing keys, like error messages, and slightly changing them.

Landed in v1.4.2 🎉 Thanks again for the great idea!

I tested it, but found some issues.

Duplicating a key seems to work well.
Creating a new key seems to work, but doesn't appear to respect the recently added 'keepFulfilled' setting. It only adds an English translation. A followup action however, like duplicating a key, will update all translation files with the missing keys.
Editing translations from the tree seems to have broken. I took a quick peek at your commit and i think I found the issue. It looks like you accidentally removed the EditKey command and register the NewKey command twice.

Also, i'm not sure if it is related to the changes you made for this feature, but i can't remember having this issue before. When switching between different files, like... i'm on the HTML file, go to my package.json, and then back to the HTML file, the side panel looks a bit messed up. Like this:

The tree and 'help & feedback' sections turn into empty 'progress' sections. And ordered differently. Hiding and showing all sections from the right-click menu seems to fix it temporarily. Until i switch between different files again.

Wow! Thanks for such detailed feedback!

and 3. are fixed in v1.4.3.

For the side panel issue, I am not sure what's the problem(it happens sometimes when I am developing). I will keep investigating it. If you can consistently reproduce it please let me know the steps! Thanks!!

Thanks for the fixes. Those seem to be working fine now.
The side panel thing seems to happen fairly consistently for me.
Basically all i do is this:

Close all files, just to make sure that nothing is opened automatically when i start VSCode again.
Close VSCode.
Open VSCode and my project, i see the welcome screen. The i18n Ally icon is not available yet in the activity bar.
I open the HTML file of a component with translations. The i18n Ally icon appears.
I click the i18n Ally icon and see all the sections correctly. 'current file', 'progress', 'tree' and 'help & feedback'.
I open the 'package.json' file of my project. The first section now turns into the 'tree', 'help & feedback' is just below, and at the very bottom is now 'progress'.
I open the same HTML file again that i had open previously. The first section is now 'help & feedback', then 'current file', 'progress' and another, but empty, 'progress' section.
I open the 'package.json' again. Now i see 3 'progress' sections. The first 2 empty and the third with the progress content.
Open the HTML file again, 'progress', 'current file', 'progress', 'progress'. Exactly like i showed in the screenshot above.

@JohanBeekers Thanks for the info. I repeated your steps but it seems to work fine for me. May I have some of your information

Your OS and Version
VSCode version
Frameworks you are using
The output of "i18n Ally"

Windows 10, version 1901, build 18363.476
VSCode 1.40.2
Angular ngx-translate
Output:

🈶 Activated, v1.4.5

――――――

💼 Workspace root changed to "c:\Users\johan.beekers\Git\MobileNXT"
Error on parsing pubspec.yaml
🌞 Enabled
🐱🏍 "Angular ngx-translate" framework(s) detected, extension enabled.
🚀 Initializing loader "c:\Users\johan.beekers\Git\MobileNXT"

📂 Loading locales under c:\Users\johan.beekers\Git\MobileNXT\src\assets\i18n
	📑 Loading (de) de.json
	📑 Loading (en) en.json
	📑 Loading (fr) fr.json
	📑 Loading (nl) nl.json

👀 Watching change on c:\Users\johan.beekers\Git\MobileNXT\src\assets\i18n

✅ Loading finished

――――――

Just to rule it out, i also just disabled every single extension except i18n ally, and i'm still having the problem that it messes up the sections when switching between files.

Okay, i made a VERY simple project and i'm still having the issue. Only the i18n Ally extension is enabled.
It only has a package.json file with the ngx-translate/core package, 1 html file and 2 translation json files.

@JohanBeekers You are awesome, dude! Thanks for being so patient for this. Now I can reproduce that.
It happens when you manually reorder the views (that's why I didn't find it out before). The extension would remove the current file view when no needed, so how this messed up with the manual position. I think it's kinda a bug of VSCode.
For now, I have made the current file view always visible as a workaround. Please update to v1.4.6 and hope it working.

Was a bit busy today, but i just tried it out and it seems to be working now.
Thank you for all these quick fixes and updates.
I'll probably come up with some more feature idea's and bugs later. 😄

@JohanBeekers Thanks for all the help! Any idea are welcome!


Java modules: add more info to website, document how/why, alternative approach with jlink/graalvm?

Java modules are hard to understand (and use), so we need to clearly show how/why they are used.
https://www.theoryofgeek.com/articles/fomo-java-module-edition

@FDelporte @savageautomate
After reading that article and having experienced some of this pain while once trying to get a JavaFX app to work and seeing that modules will never work with SpringBoot et. al. i think the best thing would be to ditch modules.
This also allows us to again make a simpler API. @savageautomate actually once even said that some API design choices were because of modules and now we have the issue that modules are more pain than gain...
If we remove the modules, then we don't really loose much. The whole plug-in infrastructure is still fine and we can still just keep the internal classes in an internal package and thus if someone uses it, and it gets changed in the future, then tough luck, the devs will have to fix their code.
What do you guys think?

P.S. I do appreciate, that @savageautomate probably did a lot of work to get modules to work, and of course it is always sad to see work become redundant... But i think i have to wholeheartedly agree with the following statement by the author of the blog entry:

I suspect the Java module system was created for one reason, and one reason alone - it is a way to technically enforce the breaking up of the JDK into individual components. The JDK team doesn’t care about stuff like Maven dependencies - that’s just end developer stuff.

On the other hand: GraalVM and other packaging solutions seem to require modules....

P.S. I do appreciate, that @savageautomate probably did a lot of work to get modules to work, and of course it is always sad to see work become redundant... But i think i have to wholeheartedly agree with the following statement by the author of the blog entry:

I'm reluctant to remove the modularization.  I do like the concept of being able to hide/restrict access to implementation APIs in a single distributed JAR -- but I'm not living in the Java world anymore ... so ultimately I would defer to whatever the best practices are for Java Library development.
As far as I know removing it will force us to define the service/plugin relationships/interfaces in the service resource files like this one:  https://github.com/Pi4J/pi4j-v2/blob/main/plugins/pi4j-plugin-raspberrypi/src/main/resources/META-INF/services/com.pi4j.extension.Plugin.   I originally includes both the service META-INF files as well as the newer modular declarations in the  module-info.java files like this: https://github.com/Pi4J/pi4j-v2/blob/main/plugins/pi4j-plugin-raspberrypi/src/main/java/module-info.java#L40.  I suspect I was having trouble with the services getting picked up properly at runtime using only the definition in module-info.java.  Of course this work was all back during Java 9 s... o something could have been broken back then.  I would propose that if we keep modularization then we get rid of these service definitions in META-INF if possible just to avoid duplicate definitions.

On the other hand: GraalVM and other packaging solutions seem to require modules....

I do think GraalVM is very interesting and something I had planned on digging into further with Pi4J and RPi -- but alas -- no time.

I would propose that if we keep modularization then we get rid of these service definitions in META-INF if possible just to avoid duplicate definitions.

That would be a big mistake. If you have a modular jar, then a user can put it on the classpath OR the module path and it should work in bot settings. Also it is often the case that test are run automatically on the classpath even if the main program uses the module path. In such a scenario you wouldn't be able to load your services properly. The definitions in META-INF and module-info are redundant but should always be present AND consistent.

I would propose that if we keep modularization then we get rid of these service definitions in META-INF if possible just to avoid duplicate definitions.

That would be a big mistake. If you have a modular jar, then a user can put it on the classpath OR the module path and it should work in bot settings. Also it is often the case that test are run automatically on the classpath even if the main program uses the module path. In such a scenario you wouldn't be able to load your services properly. The definitions in META-INF and module-info are redundant but should always be present AND consistent.

And neither JPackage/jlink nor GraalVM native-image NEED the module system. I have shown with Dirk how to use JPackage without modules here: https://github.com/dlemmermann/JPackageScriptFX and when I build JavaFX applications with GraalVM/native-image I also never needed the module system. The GraalVM mostly just ignores it.


window.addEventListener not available when running in node environment

Hello )
Is it expected that window.addEventListener is not available in node env?
Here is my snippet:
const html = `
<!DOCTYPE html>

`
const { parseHTML } = require('linkedom')
console.log('linkedom: ', parseHTML(html).window.addEventListener)

const { JSDOM } = require('jsdom')
const dom = new JSDOM(html)
console.log('jsdom: ', dom.window.addEventListener)

running this code with node results into:
linkedom:  undefined
jsdom:  [Function: bound addEventListener]

What I am trying to do is to use linkedom together with jest similarly to how it is used in jest-environment-jsdom https://github.com/facebook/jest/blob/master/packages/jest-environment-jsdom/src/index.ts

I was almost like "uhm ... OK" ... then I've seen this. The window is a proxy with accessors, overwriting globals doesn't look like good design there.
Will think about it.

🙏 grazie!

0.6.1 should work (at least that bit, I am sure there will be more changes needed).

wow that was super quick! thank you a lot!!!
will try it out )

yep ) now stuck at this point
https://github.com/facebook/jest/blob/master/packages/jest-environment-jsdom/src/index.ts#L128-L133
that is needed to execute scripts in context of the document.
=)

I don't know what that is but linkedom will never execute JavaScript in the page, resolve scripts src, or understand inline JS handlers or events ... there's JSDOM if you need that, this project won't care about replicating what a browser does, sorry.

totally understandable ) thank you again!


Facet args (and some extras)

This PR introduces a "facet.args" argument that allows users more fine-grained control over facet features. At the moment, only ncol and nrow are supported, but we can obviously add more as the need arises. (E.g. One to allow free axis limits/scales across facets.)
(FWIW @zeileis I tried to go via your "mfrow" argument idea at first. But I quickly ran into trouble because it requires users to specify both the desired no. of rows and columns ahead of time. There's a probably a smart way around this, but I think allowing separate ncol and nrow arguments is a pretty good alternative approach.)
Other features and changes bundled into this PR, addressing some issues from #90.

The default facet arrangement is now square (if more than 3 facets are detected).
Smarter axis label printing to reduce redundancy (if plot frame is turned off).
Legend cex scaled to match the actual size of facet points.
Better spacing, especially around the axis titles, between facets, and adjustments in the case of multiline facet titles. I have some other planned improvements for spacing (e.g., around the legend) but will save those for a separate PR since I don't want to confuse where breaking test changes are occurring).

Examples
pkgload::load_all("~/Documents/Projects/plot2")
#> ℹ Loading plot2

palette("dark")

data("penguins", package = "palmerpenguins")
penguins = na.omit(penguins)

with(
  penguins,
  plot2(
    x = flipper_length_mm, y = body_mass_g,
    by = sex,
    facet = species,
    main = "Palmer Penguins",
    frame = FALSE, grid = TRUE
  )
)

# Defaults to square arrangement if no. of facets > 3
with(
  penguins,
  plot2(
    x = flipper_length_mm, y = body_mass_g,
    by = sex,
    facet = interaction(sex, species, sep = "\n"),
    main = "Palmer Penguins",
    frame = FALSE, grid = TRUE
  )
)

# Override default arrangement with facet.args
with(
  penguins,
  plot2(
    x = flipper_length_mm, y = body_mass_g,
    by = sex,
    facet = interaction(sex, species, sep = "\n"),
    facet.args = list(ncol = 2),
    main = "Palmer Penguins",
    frame = FALSE, grid = TRUE
  )
)

Created on 2023-12-09 with reprex v2.0.2

Hmmm, altdoc CI check failing unexpectedly.
@etiennebacher @vincentarelbundock did something change on the altdoc side?

Perhaps, but for some reason I never seem to use vapply, so I'm 98.7% sure this is code by @etiennebacher

Yup, that was me, should be fixed on altdoc's main branch so you can re-run the CI here

Thanks etienne. I re-ran Github actions and it passes.

Thanks both!


getMappedPort/getJdbcUrl should fail fast when requested ports have not been mapped

I just tried to use the PostgreSQLContainer from within an existing unit test, as a class rule, but when I try this:
@ClassRule
public static PostgreSQLContainer postgres = new PostgreSQLContainer();

private DataSource makeDataSource() throws SQLException {
    String url = postgres.getJdbcUrl();
    log.info("JDBC URL: {}", url);
    return DataSources.unpooledDataSource(url, postgres.getUsername(), postgres.getPassword());
}

...the log message prints the following out:
JDBC URL: jdbc:postgresql://<IP_ADDRESS>:null/test

...which causes the Postgres JDBC driver to reject the URL with a "java.sql.SQLException: No suitable driver" exception.
If I edit the code above to hardcode the following URL by hand:
String url = "jdbc:postgresql://<IP_ADDRESS>:5432/test"; //postgres.getJdbcUrl();

...I get the following error instead:
org.postgresql.util.PSQLException: Connection to <IP_ADDRESS>:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:252)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
    ...

...which goes to show that the null in the URL is the cause of the failure.
Versions:

testcontainers-java: 1.0.0
docker-machine: 0.5.4, build 6643d0e
docker: 1.9.1, API: 1.21, go1.4.3, Git commit a34a1d5
OS X Yosemite 10.10.4

I've just been looking at this line of code, and I have some thoughts.
First of all, if the getMappedPort() call returns a null then the URL generation code needs to fail fast instead of composing a bogus JDBC URL.  I think this is the bare minimum for closing this ticket—if my test is failing because a port did not get mapped, I should get an error message saying that, not one that suggests that a JDBC driver was not found.
Second: since the getMappedPort() method is in the GenericContainer class, I can't help but think that this failure mode affects more than just the PostgreSQLContainer class.  Perhaps the code would benefit from being refactored so that:

getMappedPort() returns int instead of Integer;
getMappedPort() throws an exception when a caller requests a port that hasn't been mapped;
Callers that are checking whether a port has been mapped or not must use some other method than checking getMappedPort() and testing the result for null.

This is just a suggestion, though—not my code!

Hi Luca
Sorry you've had a problem, and thanks for the detailed feedback. I definitely agree that this code needs to have some more resilience. I think that:

Yes, getJdbcUrl() needs to assert that it's not getting bad data and fail-fast
Probably getMappedPort() should, as you suggest, throw an exception if you ask it for an unmapped port. I can't (yet) think of a scenario where this would be a bad thing, but will have a play.

These are really useful suggestions, so thanks.
Going back to your underlying problem, I'm surprised that you're ending up with a bad port mapping at all. The only thing that I can think of is that your makeDataSource() method is being called before the container is created. Is this possible? Do the logs show the container starting up before your method is called?
Just to be sure that it's not use of @ClassRule I've tried modifying one of the tests. It seems to work OK if run as shown below. Would you be able to try this, or something similar, to try and narrow down where the problem lies?
public class SimplePostgreSQLTest {

    @ClassRule
    public static PostgreSQLContainer postgres = new PostgreSQLContainer();

    @Test
    public void testSimple() throws SQLException {
        HikariConfig hikariConfig = new HikariConfig();
        hikariConfig.setJdbcUrl(postgres.getJdbcUrl());
        hikariConfig.setUsername(postgres.getUsername());
        hikariConfig.setPassword(postgres.getPassword());

        HikariDataSource ds = new HikariDataSource(hikariConfig);
        Statement statement = ds.getConnection().createStatement();
        statement.execute("SELECT 1");
        ResultSet resultSet = statement.getResultSet();

        resultSet.next();
        int resultSetInt = resultSet.getInt(1);
        assertEquals("A basic SELECT query succeeds", 1, resultSetInt);
    }
}

I cloned the repo, added a test like that, and it runs successfully.  Let me try and build a 1.0.2-SNAPSHOT and see if that solves my original problem.

Ok, I can now report that:

I can successfully maven install my branch, which runs all of the unit tests successfully plus your suggested one for @ClassRule.
Nevertheless, I still get the same error in my code base as I did before.

The logs show:
[Test worker] INFO org.testcontainers.dockerclient.DockerConfigurationStrategy - Looking for Docker environment. Trying Environment variables, system properties and defaults. Resolved:
    uri=https://<IP_ADDRESS>:2376
    sslConfig='LocalDirectorySSLConfig{dockerCertPath=/Users/luis.casillas/.docker/machine/machines/default}'
    version='{UNKNOWN_VERSION}'
    username='luis.casillas'
    password='null'
    email='null'
    serverAddress='https://index.docker.io/v1/'
    dockerCfgPath='/Users/luis.casillas/.dockercfg'

[Test worker] INFO org.testcontainers.dockerclient.DockerConfigurationStrategy - Found docker client settings from environment
[Test worker] INFO org.testcontainers.dockerclient.DockerConfigurationStrategy - Docker host IP address is <IP_ADDRESS>
[Test worker] INFO org.testcontainers.DockerClientFactory - Disk utilization in Docker environment is 23%
[Test worker] INFO com.progressfin.dataplatform.DataPlatformETLTest - JDBC URL: jdbc:postgresql://<IP_ADDRESS>:null/test

So it looks like what you're guessing—my makeDataSource() method is being called before the container is created.

Actually, looking at the code in my end, now it's clear what the problem is.  The unit test suite in question has a bunch of unusual, custom logic, and the makeDataSource() method is being called from the test class' constructor.  This is clearly a problem at my end.
I'll let you decide whether to close the ticket—I think my points about failing early are still worthy of consideration.

Great - I'm glad you tracked it down.
And I'll definitely act on your feedback all the same, as you're correct. In fact, I'm working on this in PR #81 right now :)


ROX-19561: Add global API and sensor message rate limit

Description
TBD
Checklist

[ ] Investigated and inspected CI test results
[x] Unit test and regression tests added
[ ] Evaluated and added CHANGELOG entry if required
~[ ] Determined and documented upgrade steps~
[ ] Documented user facing changes (create PR based on openshift/openshift-docs and merge into rhacs-docs)

Testing Performed

Unit tests which are integration tests for rate limit in gRPC server

Reminder for reviewers
In addition to reviewing code here, reviewers must also review testing and request further testing in case the
performed one does not seem sufficient. As a reviewer, you must not approve the change until you understand the
performed testing and you are satisfied with it.

This PR is closed in favor of #8116 and #8117.


Module not found in react

hello
After install on react 17 , js web app
Module not found: Can't resolve<EMAIL_ADDRESS>Checked and the module installed
Thank you

Hello!
Can you share your package.json and file where you use react-scheduler ?

Hi!
I have the same problem, have any solutions?
In page i used react-scheduler when i import "import { Scheduler, SchedulerData } from "@bitnoi.se/react-scheduler";" compliter return this error
"./src/app/views/RH/sharedBooking/ManageBooking.jsx
Module not found: Can't resolve<EMAIL_ADDRESS>in '-----------\RH\sharedBooking'"
My package.json
package.json
Thank you

I have the same problem, guys! Module not found: Can't resolve ..


Default values not provided for REDIS_DEFAULT_TTL_MS in the sample.env

Problem
The instructions don't mention to update this config in the .env in notifications and api. This was identified when running docker compose up and viewing the error. Once these configs were set with the value the error was resolved.
notifications-1  | [Nest] 34  - 12/13/2024, 1:51:36 AM   ERROR [ExceptionHandler] Config validation error: "REDIS_DEFAULT_TTL_MS" must be a number
notifications-1  | Error: Config validation error: "REDIS_DEFAULT_TTL_MS" must be a number
notifications-1  |     at ConfigModule.forRoot (/usr/src/app/node_modules/.pnpm/@nestjs+config@3.3.0_@nestjs+common@10.4.5_class-transformer@0.5.1_class-validator@0.14.1_ref_y4h4zffot46cgzyedcwdfu7yba/node_modules/@nestjs/config/dist/config.module.js:86:23)
notifications-1  |     at ./apps/notifications/src/notifications.module.ts (/usr/src/app/dist/apps/notifications/main.js:19308:40)
notifications-1  |     at __webpack_require__ (/usr/src/app/dist/apps/notifications/main.js:40914:42)
notifications-1  |     at /usr/src/app/dist/apps/notifications/main.js:40962:32
notifications-1  |     at /usr/src/app/dist/apps/notifications/main.js:40973:3
notifications-1  |     at Object.<anonymous> (/usr/src/app/dist/apps/notifications/main.js:40975:12)
notifications-1  |     at Module._compile (node:internal/modules/cjs/loader:1546:14)
notifications-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
notifications-1  |     at Module.load (node:internal/modules/cjs/loader:1317:32)
notifications-1  |     at Module._load (node:internal/modules/cjs/loader:1127:12)

Solution
Defaults should be provided in the .env so that it works as expected.
Alternatives
No response

Fixed in #1345

Fixed in #1345


error on fast switch of cameras

Cannot add output <AVCaptureMovieFileOutput: 0x1577f0f0> to capture session <AVCaptureSession: 0x168e2a20 [AVCaptureSessionPresetPhoto]> 	<AVCaptureDeviceInput: 0x157e9480 [Back Camera]> -> <AVCaptureVideoPreviewLayer: 0x157dfd10> 	<AVCaptureDeviceInput: 0x157e9480 [Back Camera]> -> <AVCaptureStillImageOutput: 0x157f2360> because more than one output of the same type is unsupported.
This is the error i got, and this is the line
  private func _getMovieOutput() -> AVCaptureMovieFileOutput {
        var shouldReinitializeMovieOutput = movieOutput == nil
        if !shouldReinitializeMovieOutput {
            if let connection = movieOutput!.connectionWithMediaType(AVMediaTypeVideo) {
                shouldReinitializeMovieOutput = shouldReinitializeMovieOutput || !connection.active
            }
        }

        if shouldReinitializeMovieOutput {
            movieOutput = AVCaptureMovieFileOutput()
            movieOutput!.movieFragmentInterval = kCMTimeInvalid

            captureSession?.beginConfiguration()

//this line is where the code exploted
            captureSession?.addOutput(movieOutput)
            captureSession?.commitConfiguration()
        }
        return movieOutput!
    }

@davidlondono Thanks for your feedback. This issue is resolved in version 2.2.4


The additional menu doesn't disappear when the transaction status is changed in the transaction details.

checked


Issue 965

Changes Unknown when pulling 08c32b0618cf371ed25b5a105a8934b524b9baa2 on wdwvt1:issue_965 into ** on biocore:master**.

Changes Unknown when pulling ce2ea5cb4656884172210bc77f33cc4872f6b985 on wdwvt1:issue_965 into ** on biocore:master**.

@ElDeveloper
I took a look this morning at the pyscopg2.Error class and it looked promising. There is an attributes of the error e.pgcode that would have been very useful. Unfortunately, the errors that we are dealing with here don't return e.pcode because they occur prior to actual initialization of the database. The pgcode's look like they are primarily for problems with accessing a running database with an active cursor. As such, I am not sure how we should change whats there now.

Thanks @wdwvt1, got it, thanks for checking that!  It's unfortunate that pgcode is not available, what about catching/looking at the specific exception types? Are different (read specific) exceptions raised for the errors that you are trying to catch?

I have updated to use OperationalError as that is the only type of error that we can catch here prior to the creation of the database.
As far as the comment about the split(':') raising an error - even if the string doesn't contain : this will not error - it just returns a list of one element.

Thanks, I will review right now, this is what I meant with the split call:
In [8]: e = 'abcdf'

In [9]: str(e).split(':')[1]
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-9-a5be9a456e29> in <module>()
----> 1 str(e).split(':')[1]

IndexError: list index out of range

:+1: if someone else can review this, it should be ready to be merged.

Coverage decreased (-0.12%) to 78.91% when pulling 69db8252c18f84b4bef43209ac4e2e27c63b973b on wdwvt1:issue_965 into 2e0fd110f0d7ac2fbc7b7aa35f2293c6bad38db3 on biocore:master.

Minor nonblocking comment, testing now.

Not sure if we want to (probably a UX consideration?), but it might be nice if possible to suppress the traceback output. I think either @jairideout or @ebolyen has done this in the past

The functionality is all there, looks good!


create bubble-sort.cpp

bubble sort

add your project's description in project_doc.md file and add your name in the list of contributors

Hey can I take this?


Fix application of optimized iterator for group by queries with a single key

Summary of the changes / Why this improves CrateDB
Fixes #15133
Checklist

[x] Added an entry in the latest docs/appendices/release-notes/<x.y.0>.rst for user facing changes
[x] Updated documentation & sql_features table for user facing changes
[x] Touched code is covered by tests
[x] CLA is signed
[x] This does not contain breaking changes, or if it does:

It is released within a major release
It is recorded in the latest docs/appendices/release-notes/<x.y.0>.rst
It was marked as deprecated in an earlier release if possible
You've thought about the consequences and other components are adapted
(E.g. AdminUI)

ok to test

Here are the benchmark results after running it against this PR:
## Running Query:
   Statement:
     select count(distinct "cCode") from uservisits
   Concurrency: 15
   Iterations: 1000
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [04:27<00:00,  3.74 requests/s]
Runtime (in ms):
    mean:    3977.048 ± 27.663
    min/max: 699.374 → 5674.092
Percentile:
    50:   4007.067 ± 446.320 (stdev)
    95:   4613.447
    99.9: 5599.754

## Running Query:
   Statement:
     select count("cCode") from (select "cCode" from uservisits group by "cCode") temp
   Concurrency: 15
   Iterations: 1000
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:14<00:00, 71.03 requests/s]
Runtime (in ms):
    mean:    200.548 ± 2.726
    min/max: 34.564 → 307.450
Percentile:
    50:   206.024 ± 43.988 (stdev)
    95:   269.634
    99.9: 307.364

unrelated flaky test
retest this please


When save markdown file, it show "No fences found!"

When save markdown file, it show "No fences found!". It only occur at markdown files even the file is empty.
If I disable the plugin, there is no Error message.
How to I check where the message from ?

sounds like a markdown plugin is notifying you of an error. Markdown plugins often support "fenced" languages in the ``` syntax.

This plugin generates the message:
https://github.com/hedyhli/markdown-toc.nvim/blob/main/lua/mtoc/init.lua#L69

@Kamilcuk Thanks reponse!


New resource: Org Setting

https://www.juniper.net/documentation/us/en/software/mist/api/http/api/orgs/setting/overview

already available with the mist_org_setting resource


A possible simpler solution

Use ActiveRecord::Enum set polymorphic field

Indeed! https://github.com/olegantonyan/polymorphic_enum_type
Thank for the idea


Cargo unexpected argument

Hello! Faced the problem that when using the cargo build system with Rust, it is not possible to use this configuration if the path contains spaces (cargo build /home/user/Desktop/Code Workspace/...)

Probably a problem here - https://github.com/sbt/sbt-jni/blob/815096ba9b6a59a079c8236e2e0bc1040d55e6a1/plugin/src/main/scala/com/github/sbt/jni/build/Cargo.scala#L37-L40

Oh right, mb could be solved by just adding extra quotation around the path. I’m 🌴now but may assist in ~ a week+.

:D took me half a year to finish it


Help with 9gag script

Hi, i use hubot with the telegram adapter (hubot-tg).
9gag.coffee just link a random 9gag link, but i'd like to make it automatically download the image and send it to the origin (for visibility). Is it possible?

Hi @davoz96, hubot only returns a link to the image. It's up to the chat client to decide how to handle it. Most chat clients will detect that it is a URL to an image and display it, so maybe you want to pass that along as a feature request to the telegram crew.


Support other editors

For example, Sublime Text
subl my_file:10
to jump to line 10 of my_file

You should be able to add the following export to your .zshrc/.bashrc file:
export TAG_CMD_FMT_STRING="subl {{.Filename}}:{{.LineNumber}}"
I had to do this so that I would be using nvim instead of the default vim.

Indeed like @kevinjalbert please read https://github.com/aykamko/tag#configuration
Should be very easy to use this for Sublime Text!


Improve in-place primitive sorts by 13-67%

Which issue does this PR close?
Closes #.
Rationale for this change
The current sort implementation for primitive types first sorts by indices and then performs a take operation. The kernel can be improved by directly sorting.
The results for i64 on my laptop are as follows
sort 2^10               time:   [9.1287 µs 9.1711 µs 9.2279 µs]
                        change: [-27.180% -25.980% -24.697%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 17 outliers among 100 measurements (17.00%)
  1 (1.00%) low severe
  2 (2.00%) low mild
  3 (3.00%) high mild
  11 (11.00%) high severe

sort 2^12               time:   [70.191 µs 70.437 µs 70.741 µs]
                        change: [-15.190% -13.941% -12.614%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 12 outliers among 100 measurements (12.00%)
  6 (6.00%) high mild
  6 (6.00%) high severe

sort nulls 2^10         time:   [4.9898 µs 5.0080 µs 5.0319 µs]
                        change: [-68.212% -67.754% -67.288%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 17 outliers among 100 measurements (17.00%)
  2 (2.00%) low mild
  5 (5.00%) high mild
  10 (10.00%) high severe

sort nulls 2^12         time:   [34.333 µs 34.641 µs 34.983 µs]
                        change: [-58.256% -57.089% -56.063%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
  3 (3.00%) high mild
  13 (13.00%) high severe

What changes are included in this PR?
I reworked the sort kernel so that primitive types are sorted directly without using sort_by_indices . I have also included a new primitive benchmark sort_kernel_primitives.rs .
Are there any user-facing changes?
No

I havent created an issue for this. Let me know if its required.

Is there some way we might reduce the amount of unsafe code here, given this is a rare special case (where you don't need the indices to sort other columns) I'm keen to keep the maintenance overheads down.

I have reworked the code to have no unsafe and reused

Is there some way we might reduce the amount of unsafe code here, given this is a rare special case (where you don't need the indices to sort other columns) I'm keen to keep the maintenance overheads down.

I have removed all unsafe code in the latest commit.

I will make these changes today.

Thanks for the above comments and the latest commit addresses them. It simplified the code a lot.


Add copyright as a "loud comment".

Similar to normalize-scss, add a loud comment stating library existence in output:
https://github.com/JohnAlbin/normalize-scss/blob/master/fork-versions/typey/_normalize.scss#L1
An additional tweak would be a shorter URL from your favorite shortener.

Nice, thanks for this.


Handling of missing lower and upper boundaries in version ranges

Fixes #3025

Looks promising! Are you able to revert the whitespace changes? We mostly use the IntelliJ defaults when formatting.

All clear; thanks again! You can use these changes immediately through our snapshot versions, such that you should now be able to run recipes against both camunda-spin, and your own copy that uses (,) as version range. Let me know how that goes!


Trying to deploy the contaier plutono with postress database

And the databases is not getting created at provisioning time.
Any idea?

Nvm, typo in the ini file


Kotlin usage

Hello, i have migrating my code from java to kotlin.
This library is so good and working perfectly in Java.
But i think it is not compatible with Kotlin yet?
I have tried a few pdf files but it cannot render it to the viewer.
It seems that i can load the page of PDF but not able to render it

Oops, i have found out the problem.
We can use it with Kotlin

And solution?


defineNuxtRouteMiddleware can not retrieve hashes the first time it enters

Environment

Operating System: Darwin
Node Version:     v20.17.0
Nuxt Version:     3.14.1592
CLI Version:      3.15.0
Nitro Version:    2.10.4
Package Manager<EMAIL_ADDRESS>Builder:          -
User Config:      default
Runtime Modules<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>Build Modules:    -

Reproduction
git@github.com:Soya-xy/game-page.git
Describe the bug
Hashe can be output normally in the browser, but can not be retrieved on the server side
Browser

Server

Additional context
No response
Logs

The fragment part (#abc) is not transferred to the server and thus can't be fetched. This is not a Nuxt issue but normal behavior from browsers!


test(joined-strategy): added failing test case

Added a test case to show that the JOINED strategy gives different results than the SELECT_IN strategy. This is the case when entity A has a ManyToOne relation with entity B. This entity B has OneToMany relations that are eager loaded with C and D.
When loading this entity A and then populating relation B using the SELECT_IN strategy it does eager load C and D. When using the JOINED strategy the relations C and D are not eager loaded.

Closing as fixed in master

Closing as fixed in master


Meta-tx community call 1 - Contract abi

Issue: Hello, I have an issue in reaching you @marekkirejczyk

Jk. Lol. I hope you don't mind this extremely intrusive and out of place github issue but I couldn't reach you anywhere else.
Alex van de sande raised an excellent suggestion of having you lead our next meta-tx community call around the contract abi standardisation
We have got a few more teams uploading their code: https://github.com/Meta-tx/Harbour-MVP/tree/master/DEMOS
We were thinking of doing this meeting this tuesday on the 16th however if that is too short of a notice, lets do it thursday / friday?
Cheers,
Peter

Hi @pet3r-pan,
I will be honored.
You can reach me via email<EMAIL_ADDRESS>Thursday sounds excellent.
Marek


On the style tag

As far as I understand, there is no style tag implemented (as mentioned in some other issue). However, is there a way to print a line that is dashed? This is usually done in the style tag, but maybe there is some way to implement some sort of custom view.

The SVG 1.1 spec primarily supported by drawSvg doesn't support the style tag.  Instead normal XML attributes are used.  See the stroke-dasharray documentation.
To make a dashed line (or path):
d.append(draw.Lines(0, 0, 20, 20, stroke_width=0.1, stroke='black', stroke_dasharray='6 4'`))


consider using LSHForest from sklearn for protein clustering

sklearn just released an LSHForest class described in "LSH Forest: Self-Tuning
Indexes for Similarity Search"
From the abstract,

Our index uses the well-known technique of locality-sensitive hashing (LSH),
but improves upon previous designs by (a) eliminating the different
data-dependent parameters for which LSH must be constantly hand-tuned, and (b)
improving on LSH's performance guarantees for skewed data distributions while
retaining the same storage and query overhead

I think (a) would be most beneficial. I'm not sure what (b) even means at this
point.
This would require a lot of RAM (so does every other solution) but at least it
has #fit_partial.
http://scikit-learn.org/stable/modules/generated/sklearn.neighbors.LSHForest.html#sklearn.neighbors.LSHForest

Toying around with this today. Paper: http://ilpubs.stanford.edu:8090/678/1/2005-14.pdf.


fix matplotlib intersphinx urls

follow-up to #10136 which passed CircleCI at the time but now fails.  Not sure if it was an upstream change or what, but this fixes it and appears not to break anything else while we're at it.

does [skip github] not work anymore?

It's skip actions, not skip github

link now works!
https://39984-1301584-gh.circle-artifacts.com/0/dev/generated/mne.viz.plot_evoked_topomap.html?highlight=gridspec
CI failure addressed in #10159


update type to pkgInDMG

Noticed today that the label for this was successfully pulling down the dmg, but was looking for "VMware Horizon Client.app" instead of the PKG installer.
Updated the type and confirmed locally.

Oop, closing this, saw someone put a much more detailed PR in the other day for the same thing. 😅 #1127

I've tried to test this new label and doesn't seem to work. Anyone else got it working?


Add helpers to precompute browser LoF flags

To avoid having to retrieve all transcript consequences from Elasticsearch, precompute flags which are shown in the browser.
Matching this behavior from gnomad_browser:
https://github.com/macarthur-lab/gnomad_browser/blob/b4ff2705fd540037acc31f234f660b26162f5207/utils.py#L95-L109

There's some additional code in gnomad_browser that impacts the value of these flags.
https://github.com/macarthur-lab/gnomad_browser/blob/b4ff2705fd540037acc31f234f660b26162f5207/utils.py#L79-L84


Unix Socket Connects Fail For Postgres

Following up from issue: 525
I'm using a typical docker compose for postgres to repro locally, that listens on unix socket: /var/run/postgresql/.s.PGSQL.5432.
version: "3.7"

services:
  db:
    image: postgres:12-alpine
    restart: always
    environment:
      POSTGRES_PASSWORD: mypassword
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    ports:
      - 5432:5432`

I am on alpha version: 2.0.0-alpha.538.  I believe this is the last alpha version before the breaking changes introduced that migrate off of photon. I would upgrade but I also use nexus-prisma, so I'm waiting on the changes coming in there.
Nexus version:     "nexus-prisma": "0.6.1",
I'm in a similar situation where I would like to use this with Google Cloud Run and Cloud SQL in GCP.
When I try to make a gql query I get this error:
Invalid `photon.()` invocation in
/home/dana/Projects/flags/flag-core/flag-api/node_modules/nexus-prisma/src/builder.ts:238:18

Error parsing connection string: empty host
    at PhotonFetcher.request (/home/dana/Projects/flags/flag-core/flag-api/node_modules/@prisma/photon/index.js:62:23)

With the connection string (replace dbname)
POSTGRESQL_URL=postgresql://postgres:mypassword@/<dbname>?host=/var/run/postgresql/

I am able to connect to this just fine using other connection methods with a connection string.

I'm also receiving this, only with Unix Socket connection.
Error parsing connection string: empty host
at PrismaClientFetcher.request (/srv/node_modules/@prisma/client/index.js:62:23)
Connection String: postgresql://postgres:password@/database?host=/cloudsql/xxxx

I can reproduce this with<EMAIL_ADDRESS>binary version: 4f8eb5bd9628db47402dc855ad0b6c7cfc915d46:

I'm encountering the same problem. I have tried each of the following variations, without success:
postgresql://USER:PASSWORD@/db-name?host=/cloudsql/CLOUD_SQL_INSTANCE_NAME
postgresql://USER:PASSWORD@/db-name?unix_socket=/cloudsql/CLOUD_SQL_INSTANCE_NAME
postgresql://USER:PASSWORD@localhost/DB_NAME?host=/cloudsql/CLOUD_SQL_INSTANCE_NAME
postgresql://USER:PASSWORD@localhost/DB_NAME?unix_socket=/cloudsql/CLOUD_SQL_INSTANCE_NAME
postgresql://USER: PASSWORD@PUBLIC_IP/DB_NAME?host=/cloudsql/CLOUD_SQL_INSTANCE_NAME
postgresql://USER: PASSWORD@PUBLIC_IP/DB_NAME?unix_socket=/cloudsql/CLOUD_SQL_INSTANCE_NAME
...where CLOUD_SQL_INSTANCE_NAME  is PROJECT_ID:REGION:INSTANCE_ID, as per Google's documentation: https://cloud.google.com/sql/docs/postgres/connect-run
In each case, I have additionally tried appending /.s.PGSQL.5432 to the end (ensuring that 5432 is the port I'm using).
I've also verified that the Cloud Run service account for my service has the necessary Cloud SQL permissions (Client, Editor, Admin).
What am I doing wrong? If nothing: Which of the above should be expected to work? Has anyone gotten a Postgres socket to work with Cloud Run?
Google's documentation cautions that " Linux based operating systems have a maximum socket path length of 107 characters." (for OSX it appears to be a few characters fewer). Does this apply to the whole connection path, or just the portion following host=?
Thanks,
-K

So the PostgreSQL examples you can find on the internet are a bit confusing (for example psql is more permissive and won't error for some cases) so to resume I tried a few things and only one works.
datasource db {
  provider = "postgresql"
  //
  // This one works on macOS
  //
  url 	   = "postgresql://username@localhost/databasename?host=/tmp"

  //
  // The following examples don't work and will error
  //

  // Can't reach database server at `/tmp/.s.PGSQL.5432`:`5432`
  url      = "postgresql://databasename?host=/tmp/.s.PGSQL.5432"

  // Error in connector: Error querying the database: db error: FATAL: no PostgreSQL user name specified in startup packet
  url      = "postgresql://databasename?host=/tmp"

  // Error parsing connection string: empty host
  url = "postgresql://username@/databasename?host=/tmp"
}

Could you try to use the folowing in your prisma.schema?
url 	   = "postgresql://username@localhost/databasename?host=/tmp"
or with password
url 	   = "postgresql://username:password@localhost/databasename?host=/tmp"
Notes:

You'll need to run npx prisma2 generate after modifying prisma.schema.
the username is required.
"localhost" can actually be anything, it's ignored but required.
the ?host=/tmp is required and can also be used in the encoded version ?host=%2Ftmp where / are replaced by %2F.

@Jolg42 I am still unable to connect. Prisma is trying to use a port:

@pantharshit00 can you try again with ?host=/tmp instead of ?host=/tmp/.s.PGSQL.5432 that worked for me.

That works for me. Not sure this behaviour is expected or not.

@pantharshit00 I think it's expected because when I try to run the following
psql "postgresql://postgres@/j42?host=/tmp/.s.PGSQL.5432"
I get
psql: error: could not connect to server: could not connect to server: Not a directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432/.s.PGSQL.5432"?`

With 2 times ".s.PGSQL.5432"

Closing, will be documented with https://github.com/prisma/prisma-client-js/issues/541


How do you stop a script?

I have npm.runInTerminal set to false so the output goes to OUTPUT pane inside Visual Studio Code editor. I'm running a watching + server script with npm script extension. How do I stop the server now?

This is a gap in the extension, sorry.
To support this the extension needs to keep track of the spawned process and provide an action to terminate/kill the spawned process.
I've turned this into a feature request.

I have the same request. Is there a workround? I tried the command Tasks: Terminate Running Task but it didn't seem to find a task I could terminate.
Also, if it helps, a 'kill all npm tasks' would work for me.

PS. Great extension!

@JonPSmith thanks.
A workaround is to set npm.runInTerminal to true then you cancel the watch job by closing the terminal window.
The real fix is that the extension remembers that process it spawned and provide an action to Terminate Running NPM Script, the action kills the spawned process. PRs are welcome 😄


Webpage displayed "Client login succeeds" but not authenticated

Hi @Voyz
Thank you for providing such a good tool. But I encounter authentication problem.
It keeps login success but not been authenticated.

Do you have any suggestion? Thank you!

Hey @chenkaiju thanks the kind words and for submitting your issue. Unfortunately, this 'authentication loop' is a problem that has been appearing for a very long time, and there is no currently known solution to it. It's been discussed in other issues, so feel free to search through for more information. One idea I've found most interesting was using VPN - I'm talking to IBKR about relevance of geolocation right now. The best idea would be for you to highlight the authentication problems with IBKR support so that they're aware of the problems we're facing. Given all that, I'm going to go ahead and close this issue, but thanks for submitting it in either case 👍

hey @chenkaiju - there is a new WIP version v0.5.0 of IBeam that introduces a new login logic, which should help reduce some of the issues we've been struggling with.
Run the most recent voyz/ibeam:0.5.0-rc* tag of v0.5.0 and set IBEAM_AUTHENTICATION_STRATEGY to B.
See #147 for more details and report any observations directly there.
Thanks 🙏