Skip to content

SDK accepts and sends none-primitive values in setTag #18163

Description

@Lms24

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/core

SDK Version

10.24.0

Framework Version

n/a

Link to Sentry event

n/a

Reproduction Example/SDK Setup

N/A

Steps to Reproduce

Sentry.setTag('tag_1', {foo: 'bar'})

Expected Result

Only tags with primitive values are sent. Object or array values should be discarded or stringified.

Actual Result

Tags with object/array values are sent

Additional Context

To be clear: Our type definitions allow only Primitive values. But in non-TS applications, users can pass in arbitrary data without necessarily being aware of this limitations.

We only document string values in our docs, so allowing primitives is already a superset here. But this seems to work well enough in the product.

However, I don't think we should send objects/arrays, etc. Especially, given that we had a test against that, which unfortunately didn't catch the violation (#18162)

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions