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

Capture and handle errors during stringify. #544

Merged
merged 2 commits into from
May 16, 2024
Merged

Conversation

purple4reina
Copy link
Contributor

@purple4reina purple4reina commented May 14, 2024

What does this PR do?

When the response object contains a circular reference, JSON.stringify will throw an error. This should be caught and ignored.

Motivation

Fixes #541

Testing Guidelines

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@purple4reina purple4reina requested a review from a team as a code owner May 14, 2024 21:35
@purple4reina purple4reina changed the title Capture and handle errors during serialize. Capture and handle errors during stringify. May 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.03%. Comparing base (78c1900) to head (6b1cf37).
Report is 13 commits behind head on main.

❗ Current head 6b1cf37 differs from pull request most recent head 143da60. Consider uploading reports for the commit 143da60 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #544      +/-   ##
==========================================
+ Coverage   81.75%   82.03%   +0.28%     
==========================================
  Files          54       56       +2     
  Lines        2209     2305      +96     
  Branches      515      533      +18     
==========================================
+ Hits         1806     1891      +85     
- Misses        337      343       +6     
- Partials       66       71       +5     

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

Copy link
Contributor

@joeyzhao2018 joeyzhao2018 left a comment

Choose a reason for hiding this comment

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

🚢

@purple4reina purple4reina merged commit 0e12153 into main May 16, 2024
25 checks passed
@purple4reina purple4reina deleted the rey.abolofia/circular branch May 16, 2024 16:59
@rdsedmundo
Copy link

@purple4reina thanks for handling this.

Is there a timeline for when this would be released as a new layer? It'd be nice to have this bugfix in our side because we are stuck with an old version of the layer due to this.

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.

Circular references are not handled in tag-object when trying to serialize Lambda's response
5 participants