Page MenuHomePhabricator

[keyserver] Replace ashoat with admin
ClosedPublic

Authored by inka on Feb 19 2024, 5:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 7:22 AM
Unknown Object (File)
Fri, Apr 19, 5:12 PM
Unknown Object (File)
Apr 5 2024, 9:19 AM
Unknown Object (File)
Mar 12 2024, 9:52 AM
Unknown Object (File)
Mar 12 2024, 9:52 AM
Unknown Object (File)
Mar 10 2024, 9:20 PM
Unknown Object (File)
Feb 29 2024, 1:42 PM
Unknown Object (File)
Feb 29 2024, 4:54 AM
Subscribers

Details

Summary
Test Plan

Tested that creating a new db is successful - a user with the id provided by identity service is created and added to the users table(with the correct name), GENESIS is correctly created with creator id set to this id, user_id field is correctly filled

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Feb 19 2024, 5:18 AM
tomek added inline comments.
keyserver/src/database/setup-db.js
25–27 ↗(On Diff #37322)

Is it OK to call createOlmAccounts before users in the DB exist?

433–453 ↗(On Diff #37322)

Can we keep inserting admin.id in the same statement where it was? It should be possible by e.g. conditionally appending a query, or creating a values array and pushing to it based on a condition.

If it appears challenging, we should at least fix the formatting - when we insert a single value, it is placed in the same line as VALUES keyword.

keyserver/src/scripts/create-community.js
14 ↗(On Diff #37322)
keyserver/src/user/identity.js
55–56 ↗(On Diff #37322)
75 ↗(On Diff #37322)
This revision is now accepted and ready to land.Feb 20 2024, 3:22 AM

Address review. I tested that the query still executes correctly for both uuid and a number like id

keyserver/src/database/setup-db.js
25–27 ↗(On Diff #37322)

Yes, createOlmAccounts doesn't fetch anything from the db. It calls createPickledOlmAccount which basically only uses olm from '@commapp/olm', and uuid from uuid'. then it stores the data in olm_accounts table. Nothing else is being done.

This revision was automatically updated to reflect the committed changes.