-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix race handling contact sync with verified info #1419
Conversation
When processing a contact sync with embedded identity key verification info, we were running overlapping async fetch/save operations on the same conversation model, causing a race that tends to clobber updates to the contact info. In this change we extend the application-level contact info handler to block on a subsequent call to the verification handler, which effectively serializes the fetch/save calls, and relieves the need for the message receiver to trigger a seperate event concerning the verification info on contact sync messages. Fixes #1408 // FREEBIE
Ha. We both tackled this one. :0) Here's my fix: https://github.com/WhisperSystems/Signal-Desktop/commits/contact-updates |
@scottnonnenberg ha. But if findOrCreate is called the second time before the first fetch resolves and populates attributes (ie timestamp) on the conversation, you could still end up fetching twice, no? |
It turns out that for any contact with My ultimate preference here would be to remove the fetches sprinkled about, and put two rules in place:
|
Here's a PR implementing those two rules, since I got pretty deep into investigating where we fetch yesterday. It's a global, long-term solution which will avoid other race conditions regarding The solution implemented in this PR will certainly work for this contact/verified race condition, but I think |
#1420 should suffice to fix the race, though I would still suggest merging this because I rather like the removal of the |
You've convinced me. Merging now... |
When processing a contact sync with embedded identity key verification info, we
were running overlapping async fetch/save operations on the same conversation
model, causing a race that tends to clobber updates to the contact info.
In this change we extend the application-level contact info handler to block on
a subsequent call to the verification handler, which effectively serializes the
fetch/save calls, and relieves the need for the message receiver to trigger a
seperate event concerning the verification info on contact sync messages.
Fixes #1408