MerginMaps / MerginMaps/qgis-plugin

unable to Extract local changes in the QGIS plugin

Open
#589 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
44
Forks
20
Avg merge
3d 12h
Merged PRs (30d)
5

Description

  1. I have created a simple project with 1 survey layer
  2. synchronized new version V2. in which I have added 3 new points
  3. I have updated 1 point (from the previous version), deleted 1 point (from the previous version), added 1 new point, after that I have saved the project and did not sync
  4. I tried to extract local changes as described in this test
image image

After I hit "run" I got this error:
image

Here is the error in text form:
Traceback (most recent call last):
File "/Users/patrikmizera/Library/Application Support/QGIS/QGIS3/profiles/test01/python/plugins/Mergin/processing/algs/extract_local_changes.py", line 118, in processAlgorithm
features = diff_table_to_features(diff[table_name], db_schema[table_name], fields, fields_mapping, db_conn)
File "/Users/patrikmizera/Library/Application Support/QGIS/QGIS3/profiles/test01/python/plugins/Mergin/diff.py", line 231, in diff_table_to_features
wkb_with_gpkg_hdr = base64.decodebytes(value.encode("ascii"))
AttributeError: 'NoneType' object has no attribute 'encode'

Execution failed after 0.09 seconds

Present in:
dev plugin with dev server
production plugin with production server

Mergin plugin artefact: https://github.com/MerginMaps/qgis-plugin/actions/runs/9482639845
Tested on MAC against app.dev (2024.4.0.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in processing/algs/extract_local_changes.py at processAlgorithm and follow the call into diff.py, especially diff_table_to_features around line 231. Reproduce the described local edits and extraction flow, then verify that extraction completes without the reported NoneType error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.