Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[web][native] Fix retrying sending message when having device without…
… keys Summary: https://linear.app/comm/issue/ENG-10141/retrying-message-on-prod-cause-it-sending-multiple-times To reproduce have a device in a "broken" state (? instead of web/mobile icon). Send a message. It will fail with log "Keys missing for device ..." but the message will be delivered. Showing that the delivery failed is ok (we couldn't deliver to the broken device) but after retrying the message will be delivered again and the other user will see duplicated messages. The exception is thrown in function returned from `useInputStateContainerSendTextMessage`. `failedOutboundP2PMessageIDs` is set correctly here. But then the exception is caught in `sendTextMessageAction` and re-thrown without setting `failedOutboundP2PMessageIDs`. `failedOutboundP2PMessageIDs` is then used do determine how we should resend the message. Therefore setting `failedOutboundP2PMessageIDs` in `sendTextMessageAction` fixes the bug. Test Plan: 1. Have a "broken" device (by logging out with v1 flow or by failing to connect the device) 2. Send a message and retry. 3. Verify the other user has no duplicated messages. Reviewers: tomek, kamil Reviewed By: kamil Subscribers: ashoat Differential Revision: https://phab.comm.dev/D14289
- Loading branch information