mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 18:45:22 +00:00
After force-quit -> relaunch the durable outbox is restored while the in-memory conversation store is not. updateAcknowledgedMessageDeliveryStatus gated the router-side clear on the conversation lookup, so a delivery ack for a retried message was discarded and the already-delivered message re-sent on every flush/auth event until the attempt cap marked it failed. Always run the peer-scoped router clear (markDelivered(_:from:) only terminalizes the acking peer's own queues); gate only the UI status transition and the media-retry release on the conversation holding the message, mirroring the Nostr path in ChatPrivateConversationCoordinator.handleDelivered. Also drop the dead allowedPeerIDs parameter on MessageRouter.clearRetainedMessage (only ever called with nil; its filter branch paired a scoped in-memory removal with an unscoped store tombstone) and the redundant manual ==/hash on PeerMessageKey. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>