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
F3183038: D11917.id39892.diff
Fri, Nov 8, 8:24 AM
F3174548: D11917.id39917.diff
Thu, Nov 7, 5:09 PM
Unknown Object (File)
Thu, Nov 7, 8:40 AM
Unknown Object (File)
Fri, Nov 1, 5:52 PM
Unknown Object (File)
Thu, Oct 24, 4:28 PM
Unknown Object (File)
Thu, Oct 24, 12:38 PM
Unknown Object (File)
Thu, Oct 24, 12:42 AM
Unknown Object (File)
Wed, Oct 23, 11:31 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