HomePhabricator
Diffusion Comm 7e3803fc86fc

[keyserver] Create olm session before creating a cookie in createAccount

Description

[keyserver] Create olm session before creating a cookie in createAccount

Summary:
issue: ENG-8046
Same as in D11780, we want to firt create the session and only then create the cookie (and in this case also add the new user to the db), so that in case the olm session creation fails, the user does not get logged in anyway

Test Plan:
Tested that before this diff, if creating the olm session failed (olmSessionPromise threw), then the user would still get registered and get a user cookie.
Checked that after this diff, if olmNotifSession throws, the user is not created in the db and they don't get a userm cookie

Reviewers: tomek, ashoat

Reviewed By: ashoat

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

Details