[Bug]: Race condition with concurrent PATCH calls on user.data field
What happened?
If you try to run concurrent PATCH calls on the same field, not all of the PATCHs will apply even though they all get 200 responses. In my testing, I'm only able to get 1 PATCH to apply when running a batch of them concurrently. For example: Five concurrent PATCH requests, each adding a different account on user.data.accountsObject:
Request 1: PATCH {user: {data: {accountsObject: {"account-1": {...}}}}} Request 2: PATCH {user: {data: {accountsObject: {"account-2": {...}}}}} Request 3: PATCH {user: {data: {accountsObject: {"account-3": {...}}}}} Request 4: PATCH {user: {data: {accountsObject: {"account-4": {...}}}}} Request 5: PATCH {user: {data: {accountsObject: {"account-5": {...}}}}}
Each of them will get a 200 response, however when you check the user afterwards only one PATCH actually applied to the user and the rest did not apply. Here's an example of this happening below in the Loom.
- https://www.loom.com/share/5adcb3e358014da095e34e7d39d3453e
Version
1.60.1
Affects Versions
No response
Alternatives / Workarounds
Run each of the PATCH calls sequentially.