HomePhabricator
Diffusion Comm 497a5f739b62

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

Description

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

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.

Reviewers: bartek, marcin, tomek

Reviewed By: marcin

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D11595