Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upCheck again for quoted messages after a short timeout #651
Conversation
this.copyFromQuotedMessage(message, attemptCount + 1); | ||
}, attemptCount * attemptCount * 500); | ||
} | ||
|
||
quote.referencedMessageNotFound = true; |
This comment has been minimized.
This comment has been minimized.
neuroscr
Nov 25, 2019
so first call and it fails, we return that it fails (instead of masking the failure), is this what you intended?
This comment has been minimized.
This comment has been minimized.
msgmaxim
Nov 25, 2019
•
Author
Collaborator
I guess so, with this PR we show the error and remove it as soon as we find the message (hopefully after 500-2000ms). I think it would be wrong to show that everything is OK at first and then (after 5 attempts or so) "oh wait, actually it wasn't". Also, if we close the app before the last attempt (so we didn't set the error), it won't ever get the chance to show this error.
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.
msgmaxim commentedNov 25, 2019
This addresses the problem of "Original message not found" that can manifest itself in bulk loading of messages (e.g. from the public chat server), resulting in a quoted message not being saved to the database when the quoting message is looking it up.
I went with the simplest solution: request the missing quoted message again after a short delay (doing it a few times with exponential backoff) and updating the quoting message accordingly.