-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: Update useragent string with npm version #13903
Changes from 6 commits
046fafc
6153320
1fe40ef
7fc9f2e
ee8428a
5933b8f
3bc52aa
3e5ac86
b76212b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ import { getCustomUserAgent } from './customUserAgent'; | |
const BASE_USER_AGENT = `aws-amplify`; | ||
|
||
class PlatformBuilder { | ||
userAgent = `${BASE_USER_AGENT}/${version}`; | ||
userAgent = `${BASE_USER_AGENT}/${version.replace(/\+.*/, '')}`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will changing this cause any issues with our metrics? Will we need to query for multiple versions of the version string now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed with product it does not affect them There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we discussed, this is going to leave the preid versions with the hash duplication. Probably non-impacting, but a bit ugly. If PM is bought in on this variation, its not a blocker for any technical reasons. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stocaaro confirmed this wont cause an issue there since the current change will still preserve the hash. Its a duplicated bit of hash that is removed. Etc, if version is |
||
get framework() { | ||
return detectFramework(); | ||
} | ||
|
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.
nit: For testing purposes this could be a some hardcoded strings
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.
i was going to do that but then we will have to mock the version in first place so for now kept the same logic
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.
You could push the version replacement into a function and then test that function with a variety of inputs/outputs.