MerginMaps / mobile

Mobile app for Mergin Maps 📲. Open QGIS projects and manage vector data on your phone, even offline 📶 (Android/iOS/Windows app)
https://merginmaps.com
GNU General Public License v2.0
297 stars 65 forks source link

Failing push finish may cause duplicate features #3642

Open wonder-sk opened 1 week ago

wonder-sk commented 1 week ago

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:

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.

tomasMizera commented 1 week ago

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 commented 1 week ago

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 🙂