Skip to content

[Fix] Make attribute encoding warnings exception-safe - #1442

Open
sbarrio wants to merge 1 commit into
sbarrio/fix/attribute-encoders-not-workingfrom
sbarrio/fix/string-attribute-encoding-can-throw
Open

sbarrio wants to merge 1 commit into
sbarrio/fix/attribute-encoders-not-workingfrom
sbarrio/fix/string-attribute-encoding-can-throw

Conversation

@sbarrio

@sbarrio sbarrio commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

The drop-warning paths in attribute encoding built their message with String(value), which itself throws on null-prototype objects or a throwing toString, so values that should have been dropped with a warning crashed the DdLogs/DdRum call. mapEncoder's catch handler had the same flaw, throwing again while reporting the first failure.

Adds safeToString (falling back to Object.prototype.toString.call) and uses it at those four sites, plus regression tests.

Motivation

Raised by #1426

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@sbarrio
sbarrio marked this pull request as ready for review September 22, 2026 12:37
@sbarrio
sbarrio requested a review from a team as a code owner September 22, 2026 12:37
@sbarrio
sbarrio marked this pull request as draft September 22, 2026 12:37
@sbarrio
sbarrio marked this pull request as ready for review September 22, 2026 14:28

This branch has not been deployed

No deployments
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.

2 participants