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

fix: Sync ScopeListeners #3065

Merged
merged 1 commit into from
Nov 23, 2020
Merged

fix: Sync ScopeListeners #3065

merged 1 commit into from
Nov 23, 2020

Conversation

HazAT
Copy link
Member

@HazAT HazAT commented Nov 20, 2020

We have a race condition in the electron SDK where we set the user on the scope but since we call the notifies in setTimeout the user is not properly propagated to the main process.

So if you have this for example:

configureScope(scope => {
    scope.setUser({ id: 'abc' }); // This invokes notify scope listeners
  });
}

captureException(new Error('test'));

On electron, we sync the scope across different processes via IPC calls.

The previous code resulted in:

IPC -> captureException
IPC -> Scope update

after the change, because we are removing the setTimeout

its:

IPC -> Scope update
IPC -> captureException

@HazAT HazAT self-assigned this Nov 20, 2020
@github-actions
Copy link
Contributor

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 19.71 KB (-0.05% 🔽)
@sentry/browser - Webpack 20.58 KB (-0.01% 🔽)
@sentry/react - Webpack 20.58 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 26.85 KB (-0.04% 🔽)

@HazAT HazAT merged commit 8054837 into master Nov 23, 2020
@HazAT HazAT deleted the fix/sync-scope-listeners branch November 23, 2020 07:59
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.

None yet

2 participants