Page MenuHomePhabricator

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

Authored by inka on Tue, May 7, 2:28 AM.
Tags
None
Referenced Files
F1785106: D11917.id39877.diff
Sat, May 18, 1:07 PM
Unknown Object (File)
Fri, May 17, 10:06 PM
Unknown Object (File)
Fri, May 17, 11:54 AM
Unknown Object (File)
Fri, May 17, 5:05 AM
Unknown Object (File)
Mon, May 13, 11:41 PM
Unknown Object (File)
Mon, May 13, 9:59 PM
Unknown Object (File)
Mon, May 13, 9:56 AM
Unknown Object (File)
Sun, May 12, 1:49 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.Tue, May 7, 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.Tue, May 7, 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