Failing push finish may cause duplicate features
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.
Hi @wonder-sk, is 404 a good way to check if transaction has been successful? What if server failed to finish the transaction?
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 🙂