Skip to content

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

@andybalaam

Description

@andybalaam

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions