-
Notifications
You must be signed in to change notification settings - Fork 123
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 typo cause it will always trigger JSON11 parse #889
Conversation
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
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, could you please add a test?
Since we have positive tests, we should add negative tests. |
Signed-off-by: Hailong Cui <[email protected]>
Thanks, a negative tests added. @dblock @AMoo-Miki |
OSD needs this in 2.x. It would be great if we had a release for it too. |
Ref: opensearch-project/opensearch-js#889 Signed-off-by: Miki <[email protected]>
Ref: opensearch-project/opensearch-js#889 Signed-off-by: Miki <[email protected]>
I'll cut a release today |
…JS client (#8839) * [@osd/std] Fix typo while inspecting values for large numerals Signed-off-by: Miki <[email protected]> * Patch @opensearch-project/opensearch to fix a typo Ref: opensearch-project/opensearch-js#889 Signed-off-by: Miki <[email protected]> * Changeset file for PR #8839 created/updated --------- Signed-off-by: Miki <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
…JS client (#8839) * [@osd/std] Fix typo while inspecting values for large numerals Signed-off-by: Miki <[email protected]> * Patch @opensearch-project/opensearch to fix a typo Ref: opensearch-project/opensearch-js#889 Signed-off-by: Miki <[email protected]> * Changeset file for PR #8839 created/updated --------- Signed-off-by: Miki <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit e993d24) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…in OSD and the JS client (#8875) * Fix a typo while inspecting values for large numerals in OSD and the JS client (#8839) * [@osd/std] Fix typo while inspecting values for large numerals Signed-off-by: Miki <[email protected]> * Patch @opensearch-project/opensearch to fix a typo Ref: opensearch-project/opensearch-js#889 Signed-off-by: Miki <[email protected]> * Changeset file for PR #8839 created/updated --------- Signed-off-by: Miki <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit e993d24) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update postinstall.js Signed-off-by: Miki <[email protected]> --------- Signed-off-by: Miki <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Miki <[email protected]>
…in OSD and the JS client (#8875) * Fix a typo while inspecting values for large numerals in OSD and the JS client (#8839) * [@osd/std] Fix typo while inspecting values for large numerals Signed-off-by: Miki <[email protected]> * Patch @opensearch-project/opensearch to fix a typo Ref: opensearch-project/opensearch-js#889 Signed-off-by: Miki <[email protected]> * Changeset file for PR #8839 created/updated --------- Signed-off-by: Miki <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit e993d24) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update postinstall.js Signed-off-by: Miki <[email protected]> --------- Signed-off-by: Miki <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Miki <[email protected]> (cherry picked from commit cd2faad) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…in OSD and the JS client (#8875) * Fix a typo while inspecting values for large numerals in OSD and the JS client (#8839) * [@osd/std] Fix typo while inspecting values for large numerals Signed-off-by: Miki <[email protected]> * Patch @opensearch-project/opensearch to fix a typo Ref: opensearch-project/opensearch-js#889 Signed-off-by: Miki <[email protected]> * Changeset file for PR #8839 created/updated --------- Signed-off-by: Miki <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit e993d24) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update postinstall.js Signed-off-by: Miki <[email protected]> --------- Signed-off-by: Miki <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Miki <[email protected]> (cherry picked from commit cd2faad) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…in OSD and the JS client (#8875) * Fix a typo while inspecting values for large numerals in OSD and the JS client (#8839) * [@osd/std] Fix typo while inspecting values for large numerals Signed-off-by: Miki <[email protected]> * Patch @opensearch-project/opensearch to fix a typo Ref: opensearch-project/opensearch-js#889 Signed-off-by: Miki <[email protected]> * Changeset file for PR #8839 created/updated --------- Signed-off-by: Miki <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit e993d24) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update postinstall.js Signed-off-by: Miki <[email protected]> --------- Signed-off-by: Miki <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Miki <[email protected]> (cherry picked from commit cd2faad) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…in OSD and the JS client (#8875) (#9037) * Fix a typo while inspecting values for large numerals in OSD and the JS client (#8839) * [@osd/std] Fix typo while inspecting values for large numerals * Patch @opensearch-project/opensearch to fix a typo Ref: opensearch-project/opensearch-js#889 * Changeset file for PR #8839 created/updated --------- (cherry picked from commit e993d24) * Update postinstall.js --------- (cherry picked from commit cd2faad) Signed-off-by: Miki <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Miki <[email protected]>
Description
Fix typo cause it will always trigger JSON11 parse.
if the json string has number in it,
numeralsAreNumbers
will always be true.(val < Number.MAX_SAFE_INTEGER || val > Number.MAX_SAFE_INTEGER)
should changed to
(val < Number.MIN_SAFE_INTEGER || val > Number.MAX_SAFE_INTEGER)
opensearch-js/lib/Serializer.js
Lines 101 to 107 in 9288450
then it will always trigger JSON11 parse
opensearch-js/lib/Serializer.js
Lines 128 to 137 in 9288450
Issues Resolved
List any issues this PR will resolve, e.g. Closes [...].
Check List
yarn run lint
doesn't show any errorsBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.