Skip to content

Bolt agent added to hello metadata #1076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
May 25, 2023
Merged

Bolt agent added to hello metadata #1076

merged 24 commits into from
May 25, 2023

Conversation

ConorNeo
Copy link
Contributor

@ConorNeo ConorNeo commented Apr 5, 2023

No description provided.

Copy link
Contributor

@bigmontz bigmontz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good so far.

I think it might worth added tests for old protocols to check if they are using the boltAgent as fallback for the case the user is not setting the userAgent.

Core features which are environment dependent will need to be implemented.
For testing this features, environment dependent tests need to be setup.

The `deno` tests can be run by `npm run test::deno` and they need to be located under `./packages/core/test/deno`.
The testkit pipeline is configured to run these tests only when configured for test `deno`.
bigmontz and others added 7 commits May 16, 2023 17:28
…gent for Deno

The test code related with `connection.connect` were calling the method without the bolt agent causing all kind of errors.
Add the bolt agent  to the calls and expectations solves the issue.

`Deno.osRelease()` and the flag `--allow-sys` are not available in Deno 1.19.2.
The missing flag was causing the test don't even start.
The method unexistance was causing the code fails because is calling a non existing method.

The missing flag is solved by using `--allow-all` instead.
This is a more permissive flag, but it is not a big deal in test env.

The absence of `Deno.osRelease()` is solved by not setting the release when this method is not available.
This might be an issue for old Deno users, but it's not a blocker.
Fix unit/integration tests related with connection.connect and bolt-agent for Deno
This property should not change the behaviour for backwards compatibility.
The `userAgent` appears on the logs and it might be parsed by reporters.
Revert changes in the `userAgent`
The BoltAgent was refactoried as structure to improve the log parser.
Implements BoltAgent as structure
@bigmontz bigmontz marked this pull request as ready for review May 24, 2023 11:14
bigmontz and others added 8 commits May 24, 2023 13:48
Handling null/undefined platform information in Browser
The basic browser tests in the lite driver is done by using a WebSocket implementation in a mocked browser.
So, mocking the `window` is needed.
`boltAgent` is not configurable, so it should not be exposed in the `Config`.
The `InternalConfig` interface was created for keeping the type-safety.

The declaration tests were failing because of multiple `AbortSignal` definitons.
This was happening because each project is using different versions of `@types/node` in the `package-lock.json`.
The problem was not happening before because any interface exposed by the `neo4j-driver-core` was depending in Node defintions.
The solution can be done or by remove the Node api  reference or by pin the  `@types/node` versions accross all packages.
The first solution was choosed since the use of `string` instead `NodeJS.Platform` in the `SystemInfo` doesn't impact the usability of the `node.boltAgent.fromVersion` function.
Fix browser tests in the lite driver
The window mock was broken because it miss `Symbol`, `Date` and other global definitions.
Set the window as `globalThis` and then define the navigator in it solves the issue.

A proper way of solving the issue will be use `jsdom`, however this plugin doesn't work in Node10.

Also fixed an issue with timers getting hanging in some situations. The issue was catched by browser test with `--detectOpenHandles`.
Fix browser test in Node10 environment
Copy link
Contributor

@bigmontz bigmontz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@bigmontz bigmontz merged commit 88ec702 into neo4j:5.0 May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants