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

setTag recording inconsistent values despite setting the same value in code #4744

Open
lukemun opened this issue Mar 31, 2025 · 10 comments
Open

Comments

@lukemun
Copy link

lukemun commented Mar 31, 2025

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

Using the React Native SDK to Sentry.setTag("XXX", true) is producing true and True values in the Sentry UI.
While we have been able to work around this, it's concerning the data is not accurate in Sentry.

Only seen it happen for "boolean" values.

Expected Result

Value is always true.

Actual Result

Image

It seems to happen sporadically and just in the Errors dataset AFAIK.

Image

Customer Specific Details in Case: https://www.notion.so/sentry/1c78b10e4b5d80f89aa9c802f6ad74fc

Product Area

Processing

Link

No response

DSN

No response

Version

No response

@getsantry
Copy link

getsantry bot commented Mar 31, 2025

Assigning to @getsentry/support for routing ⏲️

@getsantry
Copy link

getsantry bot commented Apr 1, 2025

Routing to @getsentry/product-owners-processing for triage ⏲️

@getsantry getsantry bot moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 1, 2025
@tobias-wilfert
Copy link
Member

tobias-wilfert commented Apr 3, 2025

@krystofwoldrich Is there a chance this is due to the SDK in any way? Or are we fairly certain this stems from the ingestion?

@krystofwoldrich
Copy link
Member

Thank you for the message and the ping @tobias-wilfert.

It might be a difference between JS procession of the event in the SDK when using Expo Go/Expo Dev Client and when using Release Build.

The example on the linked notion page shows an issue with a tag equal True 99% and true 1%, which supports the dev vs release suspicion.

I'm looking into it at the moment.

@krystofwoldrich
Copy link
Member

I've tried to reproduce the issue, and both in dev and release, the sdk is sending json with {"test-true": true}, but I see True in the Sentry UI.

Example Issue

@tobias-wilfert Could there be some nondeterministic behavior during processing?

@tobias-wilfert
Copy link
Member

tobias-wilfert commented Apr 10, 2025

Asked the team and it converting true -> "True" is the intended behaviour here. Would be cool if we could somehow managed to reproduce the true -> "true".

Although I am thinking now that this might probably be a issue in Relay since we have 2 different ways to convert which are used in different contexts:
https://github.com/getsentry/relay/blob/4e752d81df91a13b0f944d4859da4099de6d936d/relay-event-schema/src/protocol/types.rs#L680-L682 (True)
https://github.com/getsentry/relay/blob/4e752d81df91a13b0f944d4859da4099de6d936d/relay-event-schema/src/protocol/types.rs#L751-L753 (true)

So not sure why we hit the one or the other for the same tag but maybe it has something to do with that 🤔 but if the SDK always sends a boolean than I think it is safe to assume that it is not the culprit.

@krystofwoldrich
Copy link
Member

I've found the culprit, it's related to how we synchronize tags between native and JS.

See the nativeTags vs event.tags.

Image

I'll move this issue to the RN SDK repository.

@github-project-automation github-project-automation bot moved this to Needs Discussion in Mobile SDKs Apr 10, 2025
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 10, 2025
@krystofwoldrich krystofwoldrich transferred this issue from getsentry/sentry Apr 10, 2025
@tobias-wilfert
Copy link
Member

@krystofwoldrich Thanks so much great investigation work 🙏🏻

@krystofwoldrich
Copy link
Member

The native SDKs, sentry-cocoa and sentry-android, only accept string as a tag type, the RN SDK converts the tags to a string when passing them to the native SDKs.

@kahest kahest moved this from Needs Discussion to In Investigation in Mobile SDKs Apr 11, 2025
@krystofwoldrich
Copy link
Member

We will fix this in the RN SDK by stringifying all tags to align with the native SDK.

So the RN SDK will convert true -> 'True' and the same for the other primitives supported by the JS interface.

This has a side effect for native events, which now send true -> 'true', but after the change, they will send true -> 'True', which aligns with the RN/JS layer but could break users queries in Sentry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: In Investigation
Development

No branches or pull requests

3 participants