You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In responsive systems it is possible for a client to send two requests for one added record and backend can respond with two responses both of which will contain $PhantomId.
Use case:
User creates a record
Sync request sent out immediately
User changes the name of the added record
Backend haven't responded yet with an id, so record.isPhantom is true and sync request is sent with the added record once again.
Backend creates id for the new record and sends first response with PhantomId/id pair
Backend receives 2nd request, updates existing record and sends the response with the same PhantomId/id pair
User receives 1st response, replaces phantomid with id
User receives 2nd response with PhantomId, cannot find one (even though id exists) and adds that record as new
Arguably it is responsibility of the backend to remove PhantomId field from the 2nd response. However, there is a logic in place already which splits added array into added/updated, we need to extend it to handle existing id too.
The text was updated successfully, but these errors were encountered:
Reported by client.
In responsive systems it is possible for a client to send two requests for one added record and backend can respond with two responses both of which will contain $PhantomId.
Use case:
record.isPhantom
is true and sync request is sent with the added record once again.id
exists) and adds that record as newArguably it is responsibility of the backend to remove PhantomId field from the 2nd response. However, there is a logic in place already which splits
added
array into added/updated, we need to extend it to handle existingid
too.The text was updated successfully, but these errors were encountered: