sentry
sentry copied to clipboard
fix(u2f): Have authenticators GET wait for preloading to finish
In order to have the U2F state be correctly set in the client browser session cookie, we need to wait for preloading requests to finish first to avoid a race condition. This was done by:
- Converting the
sudo modalto a functional component so we can useuseContextin it https://github.com/getsentry/sentry/pull/71100 - Keeping track of when the preloading finishes with a hook in the
organizationLoadingContexthttps://github.com/getsentry/sentry/pull/71112 - Finally this PR, which finally has the U2F utilize the hook to wait for preloading to finish before making an authenticators GET request
Note that the PRs mentioned above must be merged first
Local Example
https://github.com/getsentry/sentry/assets/67301797/fef1a475-4e07-40ca-9741-03f6b463d5f7
Bundle Report
Changes will increase total bundle size by 20.34kB :arrow_up:
| Bundle name | Size | Change |
|---|---|---|
| app-webpack-bundle-array-push | 27.69MB | 20.34kB :arrow_up: |
PR reverted: 1fc431c28f3d98e80f2e81e64aed90363130d859