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

Failing push finish may cause duplicate features #3642

Open
wonder-sk opened this issue Oct 7, 2024 · 2 comments
Open

Failing push finish may cause duplicate features #3642

wonder-sk opened this issue Oct 7, 2024 · 2 comments
Labels
bug data corruption - sync failure - crash - anr The most critical classification sync Integration with Mergin Maps backend

Comments

@wonder-sk
Copy link
Contributor

If there is a push from the mobile app, and the "push finish" request is sent, and client gets a networking issue (e.g. "Software caused connection abort") and server successfully finished the transaction, the mobile app's client gets into an bad state:

  • server knows the push was successful
  • client thinks their push failed, so it keeps the changes it wanted to upload
    • on the next sync, the client finds out there's a new version on the server, so it rebases the local changes, which means that any newly added features get duplicated (!) and synced, and updated/deleted features are likely causing an unexpected edit conflict files (the client thinking someone else has done the same updates/deletes)

The solution could be to distinguish network errors from server errors - and in case of a network error, the client could retry "push finish" request - the server should return 404 if the transaction has been successful (and it's too early for the transaction to expire), or the server should successfully finish the transaction if it was still unfinished.

@wonder-sk wonder-sk added bug data corruption - sync failure - crash - anr The most critical classification sync Integration with Mergin Maps backend labels Oct 7, 2024
@tomasMizera
Copy link
Collaborator

tomasMizera commented Oct 8, 2024

Hi @wonder-sk, is 404 a good way to check if transaction has been successful? What if server failed to finish the transaction?

@wonder-sk
Copy link
Contributor Author

if the "push finish" request was not successful on the server for some reason, I believe the transaction will still be alive until it expires or until it is explicitly canceled with "push cancel" request from the client. But it will be good to double check the server implementation 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug data corruption - sync failure - crash - anr The most critical classification sync Integration with Mergin Maps backend
Projects
None yet
Development

No branches or pull requests

2 participants