-
Notifications
You must be signed in to change notification settings - Fork 431
LIVE-20867: prevent infinite rendering cycles when purging anonymous notifications #11332
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
LIVE-20867: prevent infinite rendering cycles when purging anonymous notifications #11332
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f67f331
to
15c776d
Compare
aa34bfa
to
b0efb94
Compare
b0efb94
to
43182d9
Compare
|
…oad-or-is-extremely-laggy-on-mac-windows LIVE-20867: prevent infinite rendering cycles when purging anonymous notifications (cherry picked from commit cab707b)
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
…oad-or-is-extremely-laggy-on-mac-windows LIVE-20867: prevent infinite rendering cycles when purging anonymous notifications
✅ Checklist
npx changeset
was attached.📝 Description
This PR addresses an infinite loop issue observed in PROD-11430, where CLEAR_DISMISSED_CONTENT_CARDS and updateAnonymousUserNotifications were repeatedly dispatched, causing extreme CPU usage and UI lag.
The issue occurs for untracked users when
anonymousUserNotifications
contains a mix of expired and valid entries during initialisation. The purge logic in useBraze partially removes expired items but still generates a new object reference on every run. Because this updated object is part of theinitBraze
dependency array, it continuously re-triggersinitBraze
, causing repeated Braze re-initialisations and excessive API calls.Fix:
❓ Context
🧐 Checklist for the PR Reviewers