mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 05:06:51 +00:00
Previous attempt at fixing a bug in the send recorder (GODT-2627) introduced a new problem where if the same message is sent multiple times with different recipients it is possible to trigger a case where the incorrect wait channel is chosen. This in turn led to IMAP client not recognizing that message has been successfully submitted. This case is represented by `TestSendHashed_SameMessageWIthDifferentToListShouldWaitSuccessfullyAfterSend` but could potentially happen over time or due some other concurrency/scheduling wake up order. To prevent this from happening every send recorder request now requires that the full list of addresses be presented. This is necessary for us to locate the correct entry and its respective wait channel. Finally each unique send recorder request is assigned an ID, in order to ensure make sure that if we ever need to cancel a request, we don't accidentally cancel a similar request if the original was removed from scope due to expiration.