-
Notifications
You must be signed in to change notification settings - Fork 90
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
refactor: update clients to have different user agents #1595
refactor: update clients to have different user agents #1595
Conversation
@brunoocasali Please review this PR 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Botseer
bors merge
1595: refactor: update clients to have different user agents r=brunoocasali a=Botseer # Pull Request ## Related issue Fixes #1437 ## What does this PR do? The users agents for BrowserClient and NodeClient have been differentiated as per the issue for better metrics. As for the code changes, I have made the change such that the necessary user agents are provided while constructing the respective client itself. Therefore there is no need to handle user agents in the `http-request` file. ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Botseer <[email protected]>
Build failed: |
@brunoocasali please do review again, sorry previously it seems I missed the tests |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1595 +/- ##
==========================================
- Coverage 97.43% 97.31% -0.12%
==========================================
Files 22 22
Lines 858 857 -1
Branches 93 87 -6
==========================================
- Hits 836 834 -2
Misses 22 22
- Partials 0 1 +1 ☔ View full report in Codecov by Sentry. |
Hey @Botseer, sorry for the late reply, but can you check why the coverage dropped? |
...config, | ||
clientAgents: [ | ||
...(config.clientAgents ?? []), | ||
`Meilisearch Node (v${PACKAGE_VERSION})`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that this package might be used by any other runtime like Deno and Bun and more, does it make sense to call it Node? Maybe it would be best if we'd only ship one client, one that runs everywhere, and is a lot more treeshakeable, but that's part of another issue.
Closing this for lack of activity. Feel free to re-open of course |
Pull Request
Related issue
Fixes #1437
What does this PR do?
The users agents for BrowserClient and NodeClient have been differentiated as per the issue for better metrics.
As for the code changes, I have made the change such that the necessary user agents are provided while constructing the respective client itself. Therefore there is no need to handle user agents in the
http-request
file.PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!