-
-
Notifications
You must be signed in to change notification settings - Fork 2
fix: wait for profile to load before showing community toast #161
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
Conversation
The toast was incorrectly showing for users with forum_username because: 1. Component mounts with profile still loading (undefined) 2. undefined is falsy, so the guard passed through 3. Toast scheduled before profile actually loaded Fix: Explicitly check for undefined and wait until profile loads. Added tests for profile loading race condition scenarios. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (feature/community-promo-toast) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #161 +/- ##
=======================================
Coverage 86.91% 86.91%
=======================================
Files 117 117
Lines 14684 14689 +5
Branches 2262 2264 +2
=======================================
+ Hits 12762 12767 +5
Misses 1922 1922
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
PR Review: Fix Community Promo Toast Race ConditionSummaryThis PR addresses a legitimate race condition bug where the community promo toast was incorrectly showing for users who already have a ✅ Strengths1. Excellent Problem Identification
2. Outstanding Test Coverage
These tests use 3. Minimal, Focused Change
4. Follows Project Conventions
🔍 Code Quality ObservationsImplementation ( ✅ Correct placement: This guard is positioned perfectly - after auth check but before the 🔒 Security & Performance✅ No security concerns: No XSS, injection, or data exposure risks 📊 Integration CheckThe hook is called in ✅ This confirms the fix is necessary - 📝 Final RecommendationAPPROVE ✅ This PR is production-ready. The fix is correct, well-tested, and follows all project conventions from Optional follow-up: After this merges, consider documenting this tri-state pattern in Reviewed with ❤️ by Claude Code |
Summary
Fixes a bug where the community promo toast was incorrectly showing for users who already have a
forum_username.Root Cause:
forumUsernameisundefined)undefinedis falsy, so the guardif (forumUsername)passed throughFix:
Explicitly check for
undefinedand wait until profile loads before deciding whether to show the toast:undefined= profile still loading, don't proceed yetnull= profile loaded, user has no forum username, show toaststring= profile loaded, user has forum username, don't show toastTest plan
forum_usernamedon't see the toastforum_usernamestill see the toast after 3 days🤖 Generated with Claude Code