Skip to content
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

[osd/std] Add fallback mechanism when recovery from false-positives in handling of long numerals fails #6253

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

AMoo-Miki
Copy link
Collaborator

@AMoo-Miki AMoo-Miki commented Mar 23, 2024

Description

Earlier, the idea was to show these errors to harden the logic. With 3+ scenarios handled, this change allows for anything else to fallback to native JSON.parse() when recovery from false-positives doesn't succeed.

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

/* Check for 1-i and 1-ii
* Finding "..."෴1111"..." inside a string value, the extra quotes throw a syntax error
* and the position points to " that is assumed to be the begining of a value.
try {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change is just a try...catch around the previous logic.

…n handling of long numerals fails

Signed-off-by: Miki <[email protected]>
Copy link

codecov bot commented Mar 23, 2024

Codecov Report

Attention: Patch coverage is 77.27273% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 67.34%. Comparing base (27d73ab) to head (cdef4b0).

Files Patch % Lines
packages/osd-std/src/json.ts 77.27% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6253      +/-   ##
==========================================
- Coverage   67.34%   67.34%   -0.01%     
==========================================
  Files        3352     3352              
  Lines       65080    65082       +2     
  Branches    10485    10486       +1     
==========================================
  Hits        43829    43829              
- Misses      18699    18700       +1     
- Partials     2552     2553       +1     
Flag Coverage Δ
Linux_1 31.82% <0.00%> (-0.01%) ⬇️
Linux_2 55.57% <54.54%> (-0.01%) ⬇️
Linux_3 44.73% <22.72%> (-0.02%) ⬇️
Linux_4 35.03% <0.00%> (-0.01%) ⬇️
Windows_1 31.84% <0.00%> (-0.01%) ⬇️
Windows_2 55.53% <54.54%> (-0.01%) ⬇️
Windows_3 44.74% <22.72%> (+<0.01%) ⬆️
Windows_4 35.03% <0.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AMoo-Miki AMoo-Miki merged commit 312075c into opensearch-project:main Mar 25, 2024
70 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 25, 2024
…n handling of long numerals fails (#6253)

Signed-off-by: Miki <[email protected]>
(cherry picked from commit 312075c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 25, 2024
…n handling of long numerals fails (#6253)

Signed-off-by: Miki <[email protected]>
(cherry picked from commit 312075c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
AMoo-Miki pushed a commit that referenced this pull request Mar 25, 2024
…n handling of long numerals fails (#6253) (#6260)

Signed-off-by: Miki <[email protected]>
(cherry picked from commit 312075c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
zhongnansu pushed a commit that referenced this pull request Apr 5, 2024
…n handling of long numerals fails (#6253) (#6259)

Signed-off-by: Miki <[email protected]>
(cherry picked from commit 312075c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@kavilla kavilla mentioned this pull request Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants