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
F3226252: D11917.id39877.diff
Mon, Nov 11, 4:10 PM
F3226102: D11917.id.diff
Mon, Nov 11, 3:30 PM
Unknown Object (File)
Mon, Nov 11, 12:27 AM
Unknown Object (File)
Sun, Nov 10, 11:41 AM
Unknown Object (File)
Fri, Nov 8, 7:18 PM
Unknown Object (File)
Fri, Nov 8, 6:03 PM
Unknown Object (File)
Fri, Nov 8, 8:24 AM
Unknown Object (File)
Thu, Nov 7, 5:09 PM
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