db-sync
db-sync copied to clipboard
Handle push errors to avoid broken sync
Sometimes it may happen that pushing a new version of a project fails for some reason (e.g. a network issue or a temporary server problem). Currently if that happens, the local directory is left with modifications - so the next time the daemon wakes up to do pull+push, the pull stage does not like the fact there are some pending changes, and the whole sync breaks.
If push fails, we should clean up the local directory - there's already a to-do left in the code: https://github.com/lutraconsulting/mergin-db-sync/blob/master/dbsync.py#L486
We've faced this issue as well. Would be great to have more tools to tackle this!
We also face this issue
Fixed in #83 - if there are any leftovers in the working directory, they will be cleaned up.