Page MenuHomePhabricator

[keyserver] modify thread creator + deleter endpoints to update communities table
ClosedPublic

Authored by ginsu on May 6 2024, 6:56 AM.
Tags
None
Referenced Files
F3303120: D11904.diff
Mon, Nov 18, 10:27 AM
Unknown Object (File)
Thu, Nov 14, 10:49 AM
Unknown Object (File)
Wed, Nov 13, 9:31 PM
Unknown Object (File)
Mon, Nov 11, 4:48 AM
Unknown Object (File)
Sun, Nov 10, 10:41 PM
Unknown Object (File)
Sun, Nov 10, 7:05 PM
Unknown Object (File)
Sun, Nov 10, 11:42 AM
Unknown Object (File)
Fri, Nov 8, 7:16 PM
Subscribers

Details

Summary

With our new communities table on the keyserver we want to make sure that if a root level thread is created or deleted (a communitiy) that we also create + delete the respective row in the communities table.

Depends on D11903

Test Plan

Created a thread through the community creation user flow + confirmed that a new row was inserted in both the threads and communities tables. Deleted that root thread (communitiy) and confirmed that the correct row was removed in both the threads table and the communities table

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu requested review of this revision.May 6 2024, 7:12 AM
keyserver/src/creators/thread-creator.js
490 ↗(On Diff #39847)

Nit: what's this space for?

491 ↗(On Diff #39847)

Do we really need to wait on createMessages etc. to complete before running this? Can we run it in parallel instead?

tomek requested changes to this revision.May 7 2024, 2:23 AM
tomek added inline comments.
keyserver/src/creators/thread-creator.js
486–489 ↗(On Diff #39847)

Can we make this insert happen in the same statement / transaction as the insert to threads table? What would happen if an exception is thrown after we insert into threads but before we insert into communities?

keyserver/src/deleters/thread-deleters.js
98 ↗(On Diff #39847)

Should we also clean this table in cron.js?

This revision now requires changes to proceed.May 7 2024, 2:23 AM
keyserver/src/deleters/thread-deleters.js
98 ↗(On Diff #39847)

This function is called by deleteInaccessibleThreads below, which is called from cron.js

keyserver/src/creators/thread-creator.js
344 ↗(On Diff #39962)

The newline is just my personal preference + I always find it easier to read w/ more space. Happy to remove if others feel strongly otherwise

keyserver/src/deleters/thread-deleters.js
98 ↗(On Diff #39962)

As mentioned by @ashoat earlier:

This function is called by deleteInaccessibleThreads below, which is called from cron.js

This revision is now accepted and ready to land.May 9 2024, 2:37 AM
This revision was landed with ongoing or failed builds.May 20 2024, 2:58 AM
This revision was automatically updated to reflect the committed changes.