Page MenuHomePhabricator

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

Authored by ginsu on Mon, May 6, 6:56 AM.
Tags
None
Referenced Files
F1785070: D11904.id39847.diff
Sat, May 18, 12:54 PM
Unknown Object (File)
Fri, May 17, 2:34 AM
Unknown Object (File)
Mon, May 13, 6:42 PM
Unknown Object (File)
Mon, May 13, 1:36 PM
Unknown Object (File)
Mon, May 13, 1:35 PM
Unknown Object (File)
Sat, May 11, 1:42 PM
Unknown Object (File)
Sat, May 11, 1:42 PM
Unknown Object (File)
Mon, May 6, 5:37 PM
Subscribers

Details

Reviewers
tomek
kamil
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.Mon, May 6, 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.Tue, May 7, 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.Tue, May 7, 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

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

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.Thu, May 9, 2:37 AM