Skip to content
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

Check again for quoted messages after a short timeout #651

Merged
merged 1 commit into from Nov 28, 2019

Conversation

@msgmaxim
Copy link
Collaborator

msgmaxim commented Nov 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.

this.copyFromQuotedMessage(message, attemptCount + 1);
}, attemptCount * attemptCount * 500);
}

quote.referencedMessageNotFound = true;

This comment has been minimized.

Copy link
@neuroscr

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.

Copy link
@msgmaxim

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.

@msgmaxim msgmaxim merged commit 7ed103f into loki-project:clearnet Nov 28, 2019
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.