Skip to content
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

Sender Data: Async migration task to prepare old sessions for fetching sender data #3547

Closed
andybalaam opened this issue Jun 13, 2024 · 1 comment

Comments

@andybalaam
Copy link
Member

andybalaam commented Jun 13, 2024

Our InboundGroupSessions store will contain old information that lacks sender data. This task is to migrate them to the new format and add a retry time so that the code from #3546 will retry fetching their data.

Part of #3544 which is part of Invisible Crypto.

Algorithm

Two options:

  • This lives in the CryptoStore impl and we need to write it 3 times, or
  • This lives outside and we expose a method to walk all inbound group sessions exactly once (maybe parameterised by a "migration id"?)

Stores where it has got up to and whether it is done.

If we're not done, walk all keys in the DB in alphabetical order, starting from where we got to.

  • If next_retry_time_ms does not exist:
    • [take the lock; if not, go to Z - we can't progress because we are not 100% sure the other task will actually update the session, delegacifying it]
    • Deserialise the session.
    • If it is a legacy session, store it.
    • [drop the lock]
  • Update "where we got to"
  • Z: Sleep for a bit

When we get to the end of all sessions, store a "done" value.

@andybalaam
Copy link
Member Author

No longer needed: see the updated task list in #3544

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

No branches or pull requests

1 participant