Skip to content

In-app cards for trade updates and new messages (push tap lands on an empty Notifications) #474

Description

@grunch

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions