Page MenuHomePhabricator

[lib] Allow multiple simultaneous calls to useUpdateRelationships from a single component
ClosedPublic

Authored by ashoat on Sep 30 2024, 8:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 2:53 AM
Unknown Object (File)
Sat, Nov 16, 12:17 AM
Unknown Object (File)
Sun, Nov 10, 4:18 PM
Unknown Object (File)
Fri, Nov 8, 3:01 AM
Unknown Object (File)
Fri, Nov 8, 3:01 AM
Unknown Object (File)
Mon, Nov 4, 4:12 PM
Unknown Object (File)
Sun, Nov 3, 3:13 AM
Unknown Object (File)
Sun, Nov 3, 3:13 AM
Subscribers

Details

Summary

In a final revision to D13443 before landing, I added some code to limit the hook to one ongoing operation per component where the hook is used.

I did this because at the time, the hook relied on a piece of React state, and could not support multiple simultaneous calls.

Later in D13496, I got rid of this React state, but I didn't reevaluate whether this limitation could be removed as well.

Given that we no longer have any issues supporting multiple simultaneous calls, I think it's best to remove this limitation. It could cause issues if useUpdateRelationships is called with a new user ID before the previous call completes. In that case, this code would cause the new user ID to be ignored.

Test Plan

I never really tested the original concern that caused me to add this limitation. I think it's safe to land this without much testing, since I had tested the functionality because I introduced this limitation and it worked correctly

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable