Skip to content

Conversation

@seer-by-sentry
Copy link
Contributor

Summary of the problem

Fixes HCB-MOBILE-2E. The issue was that: Unstable useEffect dependency (isDark) causes race condition, triggering duplicate exchangeCodeAsync call with one-time-use authorization code.

Describe your changes

The fix addresses an unstable useEffect dependency (isDark) that was causing race conditions and duplicate calls to exchangeCodeAsync.

  • Memoized the configuration object for useAuthRequest using useMemo to prevent unnecessary re-initialization of the OAuth flow when the color scheme changes.
  • Separated the logic for setting the system status bar background color into its own useEffect hook, isolating theme-related side effects.
  • Removed isDark from the dependencies of the main OAuth response handling useEffect.

This fix was generated by Seer in Sentry, triggered by Mohamad Mortada. 👁️ Run ID: 6672328.

Not quite right? Click here to continue debugging with Seer.

Checklist

  • Descriptive PR title (Does the title explain the changes in a concise manner?)
  • Tag related issues so they auto-close on merge
  • Easily digestible commits (Are the commits small and easy to understand?) video
  • CI passes (Do the GitHub checks pass?)
  • Tested by submitter before requesting review (Does it work in development iOS/android? )

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.

1 participant