Skip to content

Fix: Accept undefined as value for tags.#656

Merged
lucas-zimerman merged 4 commits intomainfrom
fix/undefined-tag
Jun 3, 2024
Merged

Fix: Accept undefined as value for tags.#656
lucas-zimerman merged 4 commits intomainfrom
fix/undefined-tag

Conversation

@lucas-zimerman
Copy link
Copy Markdown
Collaborator

@lucas-zimerman lucas-zimerman commented May 24, 2024

the behaviour on JavaScript with undefined value is to remove the tag, this wasn't respected on the native SDKs, this PR ensures that the behaviour form JavaScript also happens on the Native layer, by removing the tag.

Fixes: #647

@lucas-zimerman lucas-zimerman changed the title Fix: Accept undefined tags. Fix: Accept undefined as value for tags. May 24, 2024
@lucas-zimerman lucas-zimerman marked this pull request as ready for review May 24, 2024 01:32
Copy link
Copy Markdown
Contributor

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

I guess we can't add easy test to check that Sentry.setTag('tagKey', undefined) is translated by Capacitor to call.hasKey('value')===false.

Comment thread android/src/main/java/io/sentry/capacitor/SentryCapacitor.java
@krystofwoldrich
Copy link
Copy Markdown
Contributor

@lucas-zimerman Could you open the same fix for React Native?

@lucas-zimerman lucas-zimerman merged commit d6048d8 into main Jun 3, 2024
@lucas-zimerman lucas-zimerman deleted the fix/undefined-tag branch June 3, 2024 21:22
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.

Calling setTag with undefined value causes the SDK to throw

2 participants