-
Notifications
You must be signed in to change notification settings - Fork 291
crypto: In sqlite, use the SQL column value for backed_up everywhere #3863
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
crypto: In sqlite, use the SQL column value for backed_up everywhere #3863
Conversation
Hrm. I support the principle of being consistent, but (other than the comment asserting as much) why do we consider the sql column to be the primary source of truth?
|
When we mark the sessions as backed up, we only update the SQL column, not the pickled value.
Yeah, it modifies the serialized values.
A very tiny amount of work, yes.
This is a one-time operation though, right? Then as soon as the column exists, it is the source of truth. |
(in other words, I'd change
Right. This is the clincher. Sorry, I'd forgotten that. |
Most times we pulled an InboundGroupSession from the sqlite DB, we were overriding whatever value for `backed_up` was stored inside the pickled value, and using the value stored in the SQL column. But when we pulled a single InboundGroupSession from the DB by ID, we did not override it. I am fairly sure this was an accidental oversight, so this change corrects it, and unifies the code with other places we create these objects.
35be35c
to
dec768c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3863 +/- ##
==========================================
+ Coverage 84.09% 84.10% +0.01%
==========================================
Files 261 261
Lines 27629 27628 -1
==========================================
+ Hits 23235 23237 +2
+ Misses 4394 4391 -3 ☔ View full report in Codecov by Sentry. |
Most times we pulled an InboundGroupSession from the sqlite DB, we were overriding whatever value for
backed_up
was stored inside the pickled value, and using the value stored in the SQL column.But when we pulled a single InboundGroupSession from the DB by ID, we did not override it.
I am fairly sure this was an accidental oversight, so this change corrects it, and unifies the code with other places we create these objects.
Part of #3544
Applies on top of #3862