-
Notifications
You must be signed in to change notification settings - Fork 283
fix: mark retryable duplicated messages as received #2331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2331 +/- ##
==========================================
+ Coverage 84.99% 85.01% +0.01%
==========================================
Files 353 353
Lines 7945 7948 +3
Branches 2077 2079 +2
==========================================
+ Hits 6753 6757 +4
Misses 1010 1010
+ Partials 182 181 -1 ☔ View full report in Codecov by Sentry. |
szuperaz
approved these changes
Mar 19, 2024
Size Change: +653 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
MartinCupela
approved these changes
Mar 19, 2024
myandrienko
approved these changes
Mar 19, 2024
arnautov-anton
approved these changes
Mar 19, 2024
🎉 This PR is included in version 11.12.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
In some circumstances, the response about the delivery of a message may be aborted (timeout) or the web socket information about
message.new
might not arrive because of network conditions (offline, etc...).In this case, the SDK will prompt the user to re-send the message. Once the user retries, the backend will error with
SendMessage failed: Message with id XYZ already exists
.This error wasn't handled properly by the SDK and it led the user to re-attempt sending the same message over and over again in a loop.
This loop could have been broken only by reloading the app. This PR aims to fix that.
🛠 Implementation details
The SDK now recognizes this error, and once it happens, it immediately marks the message as
received
. This breaks the re-send loop for the user. Any UI inconsistencies (ordering of messages) related to the network glitches and optimistic rendering will be sorted out once the network connection restores and our SDK establishes a solid connection to our backend systems.