-
Notifications
You must be signed in to change notification settings - Fork 33
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 deserialization of previous contacts #324
Fix deserialization of previous contacts #324
Conversation
This caused presage to not load contacts anymore stored from previous versions.
I'm not 100% convinced that this is right: possibly we need to have this as |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #324 +/- ##
==========================================
- Coverage 16.77% 2.20% -14.58%
==========================================
Files 36 34 -2
Lines 3111 2540 -571
==========================================
- Hits 522 56 -466
+ Misses 2589 2484 -105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I don't know how exactly timer versions work, but I would expect the only way to handle a missing timer version is to start versioning the timer with version |
I'm mostly wondering about what should happen if the timer is unset: should some messages be transmitted to actually trigger the creation of a timer version? I haven't looked at this yet, but I've added it to my TODOs for my MR for WF: https://gitlab.com/whisperfish/whisperfish/-/merge_requests/627 |
Looking at the migration Signal Desktop has, they don't seem to ssend any messages. |
From what I learned reading the Signal Android patch (signalapp/Signal-Android@1f196f7#diff-324a17e5ee685f28454fe3086896076f7028a4dbde241922f1b71348cc3692c4R14), they seem to handle it by setting it to 1, unless there an expiration timer is set, in which case they set it to 2. They also do not handle groups at all. I think expiration timers are not going to be versioned for groups. or at least not for the time being. |
According to this, we should also check the recipient capabilities regarding the version. There are functions to update the timer with and without incrementing the timer. So: 1 = recipient doesn't support the versioning, 2+ = recipient supports... Right? |
Given that the Signal servers now enforce that capability, its probably save to say that the recipient supports this. Also, this MR is not for doing this absolutely correctly, this is just for fixing a regression where previous stores of presage do not work anymore, allowing applications to update presage in order to finally be able to link again (after now almost two weeks). |
I found this which explains the groups situation - the version is always one. |
Groups are handled by the group state machine itself, which is already a versioning system on its own. |
What is now the status of this PR? |
You can probably handle most of this kind of migration logic internally. But yes, some more sensible storage method would be desirable. For now, I'd just say you put the struct you propose here in Presage, and make some From and Into implementations. |
Thinking about it some more, I don't think I actually need that patch anymore. I already shipped it out to my users once, their store should now have the new field. But I'll do something like that in the next breaking change to the store. |
This caused presage to not load contacts anymore stored from previous versions.