fix chat notification not deep linking to chat screen#6282
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR fixes chat push-notification deep linking by replacing an inner
Confidence Score: 3/5Merging carries reliability risk: the 300 ms magic-number delay can silently fail to navigate on slow devices. The change fixes a real regression but uses an unawaited, arbitrary-duration delay in place of a deterministic navigation call. All async prerequisites are already awaited before the navigation point, so the delay is both unnecessary and unreliable. app/lib/pages/home/page.dart — the Future.delayed block at line 357 Important Files Changed
Sequence DiagramsequenceDiagram
participant OS as OS / FCM
participant App as App (cold start)
participant HP as HomePage.initState
participant Nav as Navigator
OS->>App: Tap chat notification (deep link)
App->>HP: addPostFrameCallback (first frame)
HP->>HP: await streamDeviceRecording
HP->>HP: await refreshMessages
Note over HP: widget tree fully settled here
HP->>HP: Future.delayed(300ms) [unawaited]
Note over HP,Nav: after 300ms (may not be enough on slow devices)
HP->>Nav: Navigator.push(ChatPage)
|
Replace arbitrary Future.delayed(300ms) with a direct Navigator.push. By the time the "chat" case runs, streamDeviceRecording and refreshMessages are already awaited, so the widget tree is fully settled and no delay is needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…6282) ## Summary - Tapping a chat push notification opened the app but stayed on the home screen instead of navigating to chat - Root cause: `addPostFrameCallback` fired before `HomePage` finished its async init work (`streamDeviceRecording`, `refreshMessages`), causing the `Navigator.push` to be silently dropped - Fix: replace `addPostFrameCallback` with a 300ms `Future.delayed` so the push happens after the widget tree has fully settled https://github.com/user-attachments/assets/9f973b93-b68e-40cd-b2b1-bc92c8659b9d 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
addPostFrameCallbackfired beforeHomePagefinished its async init work (streamDeviceRecording,refreshMessages), causing theNavigator.pushto be silently droppedaddPostFrameCallbackwith a 300msFuture.delayedso the push happens after the widget tree has fully settledScreenRecording_04-02-2026.20-56-56_1.mov
🤖 Generated with Claude Code