Page MenuHomePhabricator

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

Authored by inka on May 7 2024, 2:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 9:54 PM
Unknown Object (File)
Sun, Nov 24, 8:50 AM
Unknown Object (File)
Sun, Nov 24, 4:48 AM
Unknown Object (File)
Thu, Nov 14, 2:41 PM
Unknown Object (File)
Wed, Nov 13, 7:20 PM
Unknown Object (File)
Mon, Nov 11, 4:10 PM
Unknown Object (File)
Mon, Nov 11, 3:30 PM
Unknown Object (File)
Mon, Nov 11, 12:27 AM
Subscribers
None

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.May 7 2024, 2:45 AM
ashoat added inline comments.
keyserver/src/creators/account-creator.js
103 ↗(On Diff #39877)

I've noticed this pattern in several places, where people seem to all-caps "Olm". I don't understand why... the makers spell it as "Olm", and it is not an acronym or initialism. Can you stick with "Olm" please?

(If this was copied from somewhere, please update that place as well.)

This revision is now accepted and ready to land.May 7 2024, 6:46 AM
keyserver/src/creators/account-creator.js
103 ↗(On Diff #39877)

This was copied from a comment added in D11780, going to fix it there