HomePhabricator
Diffusion Comm 001e72586928

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

Description

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

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

Reviewers: kamil, varun, will

Reviewed By: will

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D13521

Details