Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record is duplicated when client receives response with removed phantom id and existing id #7797

Closed
bmblb opened this issue Nov 3, 2023 · 0 comments
Assignees
Labels
bug Something isn't working OEM OEM customer resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@bmblb
Copy link

bmblb commented Nov 3, 2023

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:

  1. User creates a record
  2. Sync request sent out immediately
  3. User changes the name of the added record
  4. Backend haven't responded yet with an id, so record.isPhantom is true and sync request is sent with the added record once again.
  5. Backend creates id for the new record and sends first response with PhantomId/id pair
  6. Backend receives 2nd request, updates existing record and sends the response with the same PhantomId/id pair
  7. User receives 1st response, replaces phantomid with id
  8. 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.

@bmblb bmblb added bug Something isn't working OEM OEM customer labels Nov 3, 2023
@bmblb bmblb self-assigned this Nov 3, 2023
@bmblb bmblb added the ready for review Issue is fixed, the pull request is being reviewed label Nov 3, 2023
@isglass isglass added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Nov 3, 2023
@isglass isglass added this to the 5.6.1 milestone Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OEM OEM customer resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

2 participants