Skip to content

crypto: Add a backup_version argument to group session backup methods #3253

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

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

andybalaam
Copy link
Member

@andybalaam andybalaam commented Mar 20, 2024

As outlined in element-hq/element-web#26892 (comment) , pass in the backup version we mean when we call inbound_group_sessions_for_backup and mark_inbound_group_sessions_as_backed_up. This will allow us to switch smoothly to a new backup version when the user asks to reset it, instead of modifying lots of records in our DB when this happens.

Fixes https://github.com/element-hq/crypto-internal/issues/206

@andybalaam andybalaam requested a review from a team as a code owner March 20, 2024 13:48
@andybalaam andybalaam requested review from poljar and removed request for a team March 20, 2024 13:48
@andybalaam andybalaam marked this pull request as draft March 20, 2024 13:48
@andybalaam andybalaam force-pushed the andybalaam/run-integration-tests-for-memorystore branch 2 times, most recently from 24ef7d4 to 3a7b8fc Compare March 22, 2024 09:58
Base automatically changed from andybalaam/run-integration-tests-for-memorystore to main March 25, 2024 12:23
@andybalaam andybalaam force-pushed the andybalaam/add-backup_version-arg branch from 1809e98 to fffc900 Compare March 25, 2024 13:26
@andybalaam andybalaam marked this pull request as ready for review March 25, 2024 13:27
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.62%. Comparing base (682c17c) to head (a843125).
Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3253      +/-   ##
==========================================
- Coverage   83.62%   83.62%   -0.01%     
==========================================
  Files         238      238              
  Lines       24645    24649       +4     
==========================================
+ Hits        20609    20612       +3     
- Misses       4036     4037       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit strange to add an argument that no store uses, but I presume that you have an implementation and did double check that this indeed works as intended.

Left a nit for the changelog, looks good otherwise.

@andybalaam
Copy link
Member Author

A bit strange to add an argument that no store uses, but I presume that you have an implementation and did double check that this indeed works as intended.

My plan is to check it works by implementing in the MemoryStore I'll hold off on merging this until that is done.

@andybalaam andybalaam force-pushed the andybalaam/add-backup_version-arg branch from fffc900 to 1857332 Compare April 5, 2024 15:15
@andybalaam
Copy link
Member Author

@poljar if you get time, please could you check the newest commit?

Also, I have questions about the InboundGroupSession::backed_up field, which I plan to discuss in #3306 - any input would be appreciated.

@andybalaam andybalaam force-pushed the andybalaam/add-backup_version-arg branch from 1857332 to f11aeaf Compare April 5, 2024 15:25
@richvdh richvdh requested review from richvdh and removed request for richvdh April 8, 2024 13:34
@andybalaam andybalaam force-pushed the andybalaam/add-backup_version-arg branch from b1ebb72 to a843125 Compare April 9, 2024 15:31
@andybalaam
Copy link
Member Author

I addressed the review comments and made a tiny refactor of the tests, so queuing to merge without additional review.

@andybalaam andybalaam enabled auto-merge April 9, 2024 15:32
@andybalaam andybalaam merged commit 1e7182e into main Apr 9, 2024
35 checks passed
@andybalaam andybalaam deleted the andybalaam/add-backup_version-arg branch April 9, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants