-
Notifications
You must be signed in to change notification settings - Fork 23
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
Simplify aborting in streams #989
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
47e1afa
to
824b4ec
Compare
@@ -83,7 +85,7 @@ impl DbConnection { | |||
entity_kind, | |||
cursor: 0, | |||
}; | |||
new_state.store(self)?; | |||
new_state.store_or_ignore(self)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix was a bit of a journey. Streaming got fast enough we uncovered a race condition that has been there the whole time. When you add a member to a group and have a stream running there are two syncs that happen. One from the initial add, and one triggered by reading the message from the stream.
If there is a database error like this in the sync originating from the stream, it won't wait to process the message. Then the stream handler will try to look up the message before it has been saved to the DB and return None, making it seem like the message couldn't be processed when in fact it was just processed later.
All this was causing the test_subscribe_membership_changes
test to behave flakily.
824b4ec
to
2200c1d
Compare
Summary
PrivateMessageIn
that I have now made public that will let us see what kind of message it is before decrypting.Related
xmtp/openmls#36