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
Unknown Object (File)
Sun, Dec 15, 8:24 AM
Unknown Object (File)
Thu, Dec 12, 1:10 PM
Unknown Object (File)
Tue, Dec 10, 10:30 PM
Unknown Object (File)
Thu, Nov 28, 6:58 PM
Unknown Object (File)
Sun, Nov 24, 9:52 PM
Unknown Object (File)
Sun, Nov 24, 9:50 PM
Unknown Object (File)
Sun, Nov 24, 9:47 PM
Unknown Object (File)
Sun, Nov 24, 1:55 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
Lint Not Applicable
Unit
Tests Not Applicable

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.