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

Corrected setUser TS interface to allow for null arguments #2262

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

agrzegorzewski
Copy link
Contributor

Goal

The setUser method in the notifier can take null as a parameter to clear the value from the user object. The current TypeScript interface only allows for string | undefined, which causes type errors when trying to pass null as a parameter.

BugSnag documentation mentions passing null to setUser as a possibility.

Design

The type definition has been updated to accurately reflect the capabilities od the notifier.

Changeset

The type definition for setUser's arguments has been extended from id?: string to id?: string | null.

Testing

The change was tested manually.

@mclack
Copy link
Contributor

mclack commented Nov 25, 2024

Highlighted in #1259 (comment)

Copy link

github-actions bot commented Nov 25, 2024

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 45.89 kB 13.78 kB
After 45.89 kB 13.78 kB
± No change No change

code coverage diff

<temporarily disabled>

Generated by 🚫 dangerJS against cb0081a

@gingerbenw gingerbenw force-pushed the fix/set-user-interface branch from 1be5aef to a424a21 Compare January 7, 2025 15:32
@gingerbenw gingerbenw force-pushed the fix/set-user-interface branch from a424a21 to cb0081a Compare January 8, 2025 09:34
@gingerbenw gingerbenw merged commit c65d1d8 into next Jan 8, 2025
59 checks passed
@gingerbenw gingerbenw deleted the fix/set-user-interface branch January 8, 2025 10:31
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.

3 participants