fix: push notification navigation delay and stale in-app avatar#9929
Conversation
- switchToThread: wait for CHANNEL_LIST to be top of stack instead of the unreachable HOME tab-group segment, fixing the ~30s delay when opening thread notifications while the app is running - reduce wait fallback timeouts to 1s - icon.tsx: re-subscribe to the sender's avatar when senderId changes, fixing stale avatars shown on bursty/rapid notifications
Coverage Comparison Report |
📝 WalkthroughWalkthroughNavigation flows now wait on the channel list, navigation fallback waits use 1000ms, and the in-app notification icon observes changes to ChangesNavigation synchronization
Notification icon observation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app/store/navigation_store.ts (1)
98-101: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUpdate timeout tests for the new 1,000 ms contract.
The existing test still advances 30,000 ms and only checks eventual resolution, so it would pass for either timeout value. Assert resolution at 1,000 ms and add equivalent coverage for
waitUntilScreenIsTopandwaitUntilScreensIsRemoved.Also applies to: 120-123, 141-144
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/store/navigation_store.ts` around lines 98 - 101, Update the timeout tests covering the subscription resolution paths to advance exactly 1,000 ms and assert they resolve at that boundary, rather than only checking eventual resolution after 30,000 ms. Add equivalent 1,000 ms contract coverage for waitUntilScreenIsTop and waitUntilScreensIsRemoved, preserving the existing assertions and test setup.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/actions/local/channel.ts`:
- Line 99: Remove NavigationStore coordination from the local action flows: in
app/actions/local/channel.ts at lines 99-99, move the CHANNEL_LIST load wait to
the navigation layer or caller; in app/actions/local/thread.ts at lines 90-90,
move the CHANNEL_LIST top-of-stack wait likewise. Keep both local actions
limited to database-only operations.
---
Nitpick comments:
In `@app/store/navigation_store.ts`:
- Around line 98-101: Update the timeout tests covering the subscription
resolution paths to advance exactly 1,000 ms and assert they resolve at that
boundary, rather than only checking eventual resolution after 30,000 ms. Add
equivalent 1,000 ms contract coverage for waitUntilScreenIsTop and
waitUntilScreensIsRemoved, preserving the existing assertions and test setup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c78f76ac-1d8c-4aa8-8bbb-8f0e648830f2
📒 Files selected for processing (4)
app/actions/local/channel.tsapp/actions/local/thread.tsapp/screens/in_app_notification/icon.tsxapp/store/navigation_store.ts
|
merged as this is looking good, and it is a very annoying experience |
Summary
This was already fixed once: commit 00805cc / 72fb6aa ("Fix opening push notifications after migration (#9779)") removed waitUntilScreenIsTop entirely and switched both call sites to Screens.CHANNEL_LIST + waitUntilScreenHasLoaded.
Then commit 3acf3be ("fix: app bugs surfaced by Detox RF migration (#9789)") reverted it, because it cherry-picked changes from an older migrate_RF_to_detox branch that predated the #9779 fix — reintroducing waitUntilScreenIsTop(Screens.HOME) in both files. That regression is present on HEAD right now
Ticket Link
reported here https://hub.mattermost.com/private-core/pl/a43q7tyy1bftin8opsxqng9eje
Release Note