Skip to content

fix: push notification navigation delay and stale in-app avatar#9929

Merged
Willyfrog merged 1 commit into
mainfrom
notification
Jul 22, 2026
Merged

fix: push notification navigation delay and stale in-app avatar#9929
Willyfrog merged 1 commit into
mainfrom
notification

Conversation

@enahum

@enahum enahum commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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

NONE

- 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
@enahum
enahum requested a review from larkox July 14, 2026 06:52
@enahum enahum added the 2: Dev Review Requires review by a core commiter label Jul 14, 2026
@github-actions

Copy link
Copy Markdown

Coverage Comparison Report

Generated on July 14, 2026 at 07:02:59 UTC

+-----------------+------------+------------+-----------+
| Metric          | Main       | This PR    | Diff      |
+-----------------+------------+------------+-----------+
| Lines           |     87.74% |     87.73% |    -0.01% |
| Statements      |     87.60% |     87.60% |     0.00% |
| Branches        |     76.57% |     76.58% |     0.01% |
| Functions       |     87.19% |     87.21% |     0.02% |
+-----------------+------------+------------+-----------+
| Total           |     84.77% |     84.78% |     0.01% |
+-----------------+------------+------------+-----------+

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Navigation flows now wait on the channel list, navigation fallback waits use 1000ms, and the in-app notification icon observes changes to senderId.

Changes

Navigation synchronization

Layer / File(s) Summary
Navigation targets and timeout handling
app/actions/local/channel.ts, app/actions/local/thread.ts, app/store/navigation_store.ts
Channel and thread actions use Screens.CHANNEL_LIST for synchronization, and three navigation wait utilities use 1000ms fallback timeouts.

Notification icon observation

Layer / File(s) Summary
Sender-dependent notification observation
app/screens/in_app_notification/icon.tsx
The observable dependency list includes senderId, causing derived notification data to recompute when it changes.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: notification navigation delays and stale in-app avatars.
Description check ✅ Passed The description is clearly related to the changeset and explains the reverted navigation fix and avatar update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch notification

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/store/navigation_store.ts (1)

98-101: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Update 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 waitUntilScreenIsTop and waitUntilScreensIsRemoved.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 41c1300 and d7b8206.

📒 Files selected for processing (4)
  • app/actions/local/channel.ts
  • app/actions/local/thread.ts
  • app/screens/in_app_notification/icon.tsx
  • app/store/navigation_store.ts

Comment thread app/actions/local/channel.ts
@Willyfrog
Willyfrog merged commit 7e20075 into main Jul 22, 2026
30 of 33 checks passed
@Willyfrog
Willyfrog deleted the notification branch July 22, 2026 12:15
@Willyfrog

Copy link
Copy Markdown
Contributor

merged as this is looking good, and it is a very annoying experience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2: Dev Review Requires review by a core commiter release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants