Is your feature request related to a problem? Please describe.
Dispute chat subscriptions use an isolated StreamSubscription created directly in DisputeChatNotifier, separate from SubscriptionManager. At the same time, SubscriptionManager already creates a disputeChat subscription (kind 1059 filtered on adminSharedKey pubkeys) but nothing in the codebase listens to that stream. Both subscriptions run in parallel, sending duplicate REQ messages to relays, while only the isolated one is actually used.
Describe the solution you'd like
Remove the isolated subscription from DisputeChatNotifier and use the existing disputeChat stream from SubscriptionManager instead. This would eliminate the duplicate relay REQs and centralize dispute chat subscription management.
Warning: A previous attempt to do this caused a regression. SubscriptionManager refreshes all subscriptions on every session change (including when an order is created), which reset active dispute chat subscriptions mid-flow. Any implementation needs to account for this behavior.
Describe alternatives you've considered
Keeping the isolated subscription as-is. It works but leaves a dead disputeChat stream in SubscriptionManager (zero listeners) and sends unnecessary duplicate REQs to relays on every active dispute.
Additional context
- Related files:
subscription_manager.dart, dispute_chat_notifier.dart
- Documented in
docs/architecture/DISPUTE_CHAT_RESTORE.md
Is your feature request related to a problem? Please describe.
Dispute chat subscriptions use an isolated
StreamSubscriptioncreated directly inDisputeChatNotifier, separate fromSubscriptionManager. At the same time,SubscriptionManageralready creates adisputeChatsubscription (kind 1059 filtered onadminSharedKeypubkeys) but nothing in the codebase listens to that stream. Both subscriptions run in parallel, sending duplicate REQ messages to relays, while only the isolated one is actually used.Describe the solution you'd like
Remove the isolated subscription from
DisputeChatNotifierand use the existingdisputeChatstream fromSubscriptionManagerinstead. This would eliminate the duplicate relay REQs and centralize dispute chat subscription management.Warning: A previous attempt to do this caused a regression.
SubscriptionManagerrefreshes all subscriptions on every session change (including when an order is created), which reset active dispute chat subscriptions mid-flow. Any implementation needs to account for this behavior.Describe alternatives you've considered
Keeping the isolated subscription as-is. It works but leaves a dead
disputeChatstream inSubscriptionManager(zero listeners) and sends unnecessary duplicate REQs to relays on every active dispute.Additional context
subscription_manager.dart,dispute_chat_notifier.dartdocs/architecture/DISPUTE_CHAT_RESTORE.md