-
Notifications
You must be signed in to change notification settings - Fork 268
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
Migrate inbound_group_session2 to fix keys incorrectly copied from old store version #2957
Conversation
Signed-off-by: Andy Balaam <[email protected]>
Signed-off-by: Andy Balaam <[email protected]>
Signed-off-by: Andy Balaam <[email protected]>
Signed-off-by: Andy Balaam <[email protected]>
Signed-off-by: Andy Balaam <[email protected]>
Signed-off-by: Andy Balaam <[email protected]>
Signed-off-by: Andy Balaam <[email protected]>
39ea3d8
to
f81fb61
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2957 +/- ##
=======================================
Coverage 83.50% 83.50%
=======================================
Files 221 221
Lines 23007 23007
=======================================
Hits 19211 19211
Misses 3796 3796 ☔ View full report in Codecov by Sentry. |
Running a |
OK, Rich helped me figure out it was due to missing calls to |
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.
lgtm otherwise.
Signed-off-by: Richard van der Hoff <[email protected]>
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.
I don't have all the knowledge to validate this patch, but the code looks good (modulo 2 tiny comments).
Thanks @Hywan! I'm pretty happy with this from the functionality side, so if you're happy from the code style side, I think we're good to go. |
Co-authored-by: Ivan Enderlin <[email protected]> Signed-off-by: Richard van der Hoff <[email protected]>
Fixes element-hq/element-web#26782
In migrate_data_for_v6, we incorrectly copied the keys in inbound_group_sessions verbatim into inbound_group_sessions2. What we should have done is re-encrypt them using the new table name, so we fix that up with a new migration here.
This caused the bug because we were looking for sessions to mark as backed up by calculating their key (from room_id and session_id) but that key did not exist, because the old sessions were stored under the incorrect keys. So no sessions were marked as backed up, and we repeatedly tried to re-mark them.
Depending on your taste you might like to review this commit by commit.