sentry icon indicating copy to clipboard operation
sentry copied to clipboard

fix(u2f): Have authenticators GET wait for preloading to finish

Open schew2381 opened this issue 1 year ago • 1 comments

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:

  1. Converting the sudo modal to a functional component so we can use useContext in it https://github.com/getsentry/sentry/pull/71100
  2. Keeping track of when the preloading finishes with a hook in the organizationLoadingContext https://github.com/getsentry/sentry/pull/71112
  3. 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

schew2381 avatar May 17 '24 23:05 schew2381

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:

codecov[bot] avatar May 20 '24 16:05 codecov[bot]

PR reverted: 1fc431c28f3d98e80f2e81e64aed90363130d859

getsentry-bot avatar May 22 '24 18:05 getsentry-bot