You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The \\?\ prefix is applied only at the filesystem call and never appears in the push payload. The geodiff half needs pygeodiff 2.3.2, which is bumped in a separate PR.
Debugging info:
Pull works as py-client saves the diffs to tmp dir
However, there is always a check if there's something to push after the pull.
Push treats every gpkg with editing mode enabled as well as with original vs. current gpkg checksum mismatch (which is quite common) as potentially updated, and we rely on geodiff to calculate the real changes. Geodiff creates an empty diff file even when there is no change.
Geodiff's create_changeset() fails because it's not possible to create a file due to the Windows path length limit. It then pushes the whole file. Then we want to apply the push changes to the basefile. So geodiff removes the original geopackage and copies the current copy, which apparently changes the checksum, and we're caught in the loop. ➿
Site
Feature
merginproject.py get_push_changes
push
merginproject.py get_local_delta
pull, local changes detection
client_pull.py get_download_diff_files
pull, v1 fallback
client_pull.py pull_project_async v2 loop
pull, v2
client_pull.py download_diffs_async
get_file_diff / version viewer / reports
This is a minimal fix for the issue.
There are other enhancements/issue mitigations:
Shorten diff name
Store diff files locally under a short, flat name, decoupled from the file's path in the project — e.g. .mergin/diffs/ instead of .mergin/-diff-. Fixes works esp. for files nested deep in the subfolders. This does not require server changes - the server doesn't care what we call the local file.
Path
Length
Live file <rel>
P + R + 1
Basefile .mergin<rel> — already mandatory today
P + R + 9
Diff today .mergin<rel>-diff-
P + R + 51
Diff flattened .mergin\diffs<uuid>
P + 51 (constant)
Same, 16-char id
P + 31 (constant)
Safeguard for any infinite sync loop sync_project_generator's while has_changes has no iteration limit. Track, per file, how many consecutive iterations it was pushed as a full upload with no diff; if the same versioned file does this N times in a row (e.g. 2–3), raise a ClientError naming the file instead of continuing. This is cause-agnostic - it also protects against any other future reason a changeset can't be computed.
Long path error workaround
Use \\?\-prefixed paths for geodiff calls and other file I/O.
4. Use a temp folder for push diffs, as it is used for pull diffs already.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes MerginMaps/qgis-plugin#932
This adds an extended-path prefix to all Python filesystem operations on Windows so that it can work with files&folder > 260 characters.
Verified on Windows with OS long-path support off (default install), project path 317 chars: https://github.com/MerginMaps/python-api-client/actions/runs/39755718281
The
\\?\prefix is applied only at the filesystem call and never appears in the push payload. The geodiff half needs pygeodiff 2.3.2, which is bumped in a separate PR.