Skip to content

Dispute chat messages cannot be sent/received after account restore #508

@mostronatorcoder

Description

@mostronatorcoder

Description

After a user restores their account, dispute chat between user and admin stops working. The admin does not receive messages from the user, and the user does not receive messages from the admin.

Steps to reproduce

  1. Have an active dispute with ongoing admin chat
  2. Clear app data or reinstall
  3. Restore account from seed/backup
  4. Open the dispute
  5. Try to send a message to the admin → admin does not receive it
  6. Admin sends a message → user does not receive it

Expected behavior

After account restoration, dispute chat should resume working. The user should be able to send and receive messages with the admin.

Root cause (hypothesis)

The restore process likely does not re-establish the necessary session keys or shared secrets required for dispute chat encryption (gift wrap / NIP-59). The getAdminSharedKey() may depend on session state that is not reconstructed during restore.

Possible factors:

  • Trade keys not fully restored
  • Admin shared key derivation requires session data not available post-restore
  • Subscription to dispute chat relay events not re-established

Possible solution

  • Ensure the restore manager reconstructs all keys needed for dispute chat
  • Re-subscribe to dispute chat events after restore
  • Verify getAdminSharedKey() works with restored key material

Context

Reported by @BraCR10 during testing of PR #501. This is a pre-existing issue not introduced by that PR — the restore manager's handling of dispute chat state predates the refactor.

Labels

  • bug
  • area: disputes
  • area: restore

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions