Reception only ran inside an open ChatScreen for a known peer, so a first message from a new peer was invisible: nothing in local storage -> nothing in the inbox list -> you never opened the chat -> you never subscribed. Add InboxService: one long-lived NIP-17 inbox subscription for the whole app (foreground), persisting every incoming message to MessageStore and firing a 'changes' signal the inbox list live-reloads on. Reconnects when the network returns; degrades to nothing offline. Started from main when a social identity exists. Make MessageStore.append idempotent (dedup by sender+timestamp+text) and serialized behind a write lock — the global listener and an open chat's own subscription now write the same conversation concurrently and relays re-deliver stored gift wraps on every resubscribe. Tests for both. Known trade-offs (follow-ups): foreground-only (no push yet); each of InboxService/ChatScreen/MarketScreen opens its own RelayPool (a shared connection is a later optimization). |
||
|---|---|---|
| .. | ||
| ocr | ||
| auto_backup_service_test.dart | ||
| auto_backup_store_test.dart | ||
| discovery_area_test.dart | ||
| export_import_service_test.dart | ||
| inbox_service_test.dart | ||
| locale_store_test.dart | ||
| message_store_test.dart | ||
| offer_outbox_test.dart | ||
| profile_cache_test.dart | ||
| profile_store_test.dart | ||
| share_catalog_service_test.dart | ||
| social_service_test.dart | ||
| social_settings_test.dart | ||