Page MenuHomePhabricator

[web/native] make `overwrite` param for inbound session mandatory and unify web & native
ClosedPublic

Authored by kamil on Apr 9 2024, 4:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 22, 3:03 AM
Unknown Object (File)
Sun, Dec 22, 3:03 AM
Unknown Object (File)
Sun, Dec 22, 3:03 AM
Unknown Object (File)
Sun, Dec 22, 3:03 AM
Unknown Object (File)
Sun, Dec 22, 3:03 AM
Unknown Object (File)
Sun, Dec 22, 3:03 AM
Unknown Object (File)
Sun, Dec 22, 3:03 AM
Unknown Object (File)
Thu, Nov 28, 2:02 AM
Subscribers

Details

Summary

When discovering the race condition we will need to sometimes overwrite the existing session. This diffs makes this param mandatory and unifies usage on native & web.

This changes the functionality of overwrite:

  • when there is no session - create it
  • when there is an existing session with a lower version - overwrite always
  • when there is an existing session with a higher version - throw an error
  • when there is an existing session with the same version - throw error (we allow JS to decide how to handle race condition
  • when there is an existing session and overwrite is set to true - create a new session (even is version is lower)

Depends on D11594

Test Plan

Tested in next diff in the stack.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
web/shared-worker/worker/worker-crypto.js
429–433 ↗(On Diff #38945)

Should we be using olmSessionErrors here?

This revision is now accepted and ready to land.Apr 11 2024, 12:57 AM

use olmSessionErrors instead of hardcoded string

web/shared-worker/worker/worker-crypto.js
429–433 ↗(On Diff #38945)

definitely we should, thanks for catching