Problem
Since PR-2 (#471), tapping a push opens the app on /notifications (docs/PUSH_NOTIFICATIONS.md §10: the push carries no payload, so the resync's in-app cards are meant to say what the wake was about). But nothing creates those cards today:
NotificationsNotifier.onTradeUpdated and onNewMessage (lib/features/notifications/providers/notifications_provider.dart) are never called.
- The only producers of cards are the bond consumers in
lib/core/app_bootstrap.dart (_consumeBondSlashed, _consumeBondClaims), through addIfNew.
hydrateNotifications only reloads persisted Sembast records.
So after a trade_update push the user lands on an empty or stale screen. Raised by Codex on #471.
Scope
- Consume the trade-update stream (
orders_api.onTradeUpdated, TradeUpdate { order_id, status, reason }) and the chat new-message stream in bootstrap, like the bond consumers, writing through addIfNew.
- A deterministic id so the resync's replay yields exactly one card per change (e.g.
order_id + status), preserving read/delete state.
- Store stable data only; localize at render time in the 5 ARBs. The current stubs hardcode English (
'Trade updated', 'New message').
- Respect the
notify_trade_updates / notify_new_messages toggles.
- Delete or replace the unused
onTradeUpdated / onNewMessage stubs.
- Tests: replay dedup, toggle gating, card copy per locale.
Until then the §10 promise ("tapping it opens the app on Notifications with the corresponding in-app card already present") does not hold; update the doc if the approach changes.
Problem
Since PR-2 (#471), tapping a push opens the app on
/notifications(docs/PUSH_NOTIFICATIONS.md §10: the push carries no payload, so the resync's in-app cards are meant to say what the wake was about). But nothing creates those cards today:NotificationsNotifier.onTradeUpdatedandonNewMessage(lib/features/notifications/providers/notifications_provider.dart) are never called.lib/core/app_bootstrap.dart(_consumeBondSlashed,_consumeBondClaims), throughaddIfNew.hydrateNotificationsonly reloads persisted Sembast records.So after a
trade_updatepush the user lands on an empty or stale screen. Raised by Codex on #471.Scope
orders_api.onTradeUpdated,TradeUpdate { order_id, status, reason }) and the chat new-message stream in bootstrap, like the bond consumers, writing throughaddIfNew.order_id+status), preserving read/delete state.'Trade updated','New message').notify_trade_updates/notify_new_messagestoggles.onTradeUpdated/onNewMessagestubs.Until then the §10 promise ("tapping it opens the app on Notifications with the corresponding in-app card already present") does not hold; update the doc if the approach changes.