Page MenuHomePhabricator

[keyserver] Handle accepting the invitation
ClosedPublic

Authored by tomek on Apr 21 2023, 2:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 6:37 PM
Unknown Object (File)
Fri, Nov 29, 5:32 PM
Unknown Object (File)
Fri, Nov 8, 10:06 AM
Unknown Object (File)
Oct 28 2024, 1:26 AM
Unknown Object (File)
Oct 28 2024, 1:26 AM
Unknown Object (File)
Oct 28 2024, 1:26 AM
Unknown Object (File)
Oct 28 2024, 1:26 AM
Unknown Object (File)
Oct 28 2024, 1:25 AM
Subscribers

Details

Summary

We do a lot of things when joining a thread so it made more sense to use already created logic for this. If the link secret is provided, we're checking link validity instead of permissions and based on the result continue with the process. This implementation has small issue, because it is possible that e.g. server crashes between adding someone to a thread and reporting link usage. This is a really unlikely corner case, which probably can be fixed by using transactions (there might be some other solutions, but probably complicated). At this point we're not handling link expiration, so I'll take a look at the solutions while implementing the remaining part.

Depends on D7525

Test Plan

Tested in combination with the next diff. Clicking join button should add a user to a community and a field in the db should be incremented.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Apr 21 2023, 2:57 AM
keyserver/src/updaters/thread-updaters.js
868 ↗(On Diff #25502)

Do we need to block the response on this? Can this be wrapped in handleAsyncPromise instead of using await?

keyserver/src/updaters/thread-updaters.js
868 ↗(On Diff #25502)

Yeah, we could do that. But in the future it would be great if we could ensure that either user joined a community and counter increased, or user didn't join and counter didn't increase. Currently, there's a slight probability that after a user joins, we don't increase the counter (after e.g. server crash).

This revision is now accepted and ready to land.Apr 26 2023, 5:40 AM

Do not await report promise

This revision was automatically updated to reflect the committed changes.