Skip to content

sc-tech-task: modify identity store implementation

context

  • before running a large ETL job to migrate signald data to signalc, we want to make changes to the identity keystore to make sure it behaves the way we want post-migration and to streamline the ETL itself

changes

  • eliminate device ids as field in IdentityKeyStore
    • semantics of this: maintain a 1-to-1 relationship between an account's id (uuid/e164) and its identity (both signal-cli and signal-android do this)
    • ie: throw out deviceId field passed to #saveIdentity and #loadIdentity and merely extract an account's identifier
    • as consequence of above: perform lookups for trust calls by contactId field, not fingerprint (since fingerprint was a clever way to find all fingerprints for a given contact id, assuming there might be different device ids, which there are not)
  • when new identities are received (for contacts for whom we already have an identity)
    • overwrite old ones (as signal-android does and we currently do)
      • effect on ETL job: we will not transfer outdated identity records maintained by signald (which does not overwrite old identities in the persistence layer)
    • follow signal-android in implementing archiveSiblingSessions when a new identity is saved
  • add an updatedAt field on identities table (b/c low cost and potentially useful in sleuthing)
    • effect on ETL: we will transfer this field from signald (but make it nullable so we don't have to backfill our dev envs)

progress

  • eliminate device ids in IdentityKeyStore
  • look up identities for trust calls by accountId-contactId tuple (not fingerprint)
  • add updatedAt field to Identities
  • implement archiveSiblingSession
Edited by aguestuser
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information