Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes are not written to data.gpkg by QField #609

Closed
samillar94 opened this issue Aug 1, 2019 · 8 comments
Closed

Changes are not written to data.gpkg by QField #609

samillar94 opened this issue Aug 1, 2019 · 8 comments
Labels

Comments

@samillar94
Copy link

I have been wasting hours trying to get changes in QField to sync to QGIS, and have narrowed it down to a failure by QField to add new features to the log_added_features layer in data.gpkg.

Reproduction Steps:

  1. Layers set to offline editing and project exported
  2. Files copied to mobile and features added in QField
  3. In QGIS master project, hit "Synchronise from QField"

Expected behavior:

Entries in log_added_features and addition of new features to master project layers.

Observed behavior:

No entries in log_added_features, no features transferred, no error messages.

QField version: 1.1.0

Additional information:

  • Problem can be reliably reproduced, doesn't happen randomly: Yes
  • Problem happens with all files and projects, not only some files or projects: Yes

I'm running QField on a Huawei P Smart.

@saemiw
Copy link

saemiw commented Oct 9, 2019

I was not able to reproduce the issue with QGIS 3.4.12, QField 1.2.0 using qfieldSync for setting the project offline. And yes I also used geopackages

@rwjdennis
Copy link

I'm also having this problem. Looking at the geopackage log files, it appears for my project that the layer_id references may be wrong.
For example, when I export my project with QFieldSync, the point layer name "Trees_Field" gets a long string appended to it (e.g., "Trees_Field_bde016a9_22e3_4e6e_aaf5_e7945f43aaf5"), and the layer now has "(offline)" beside it. When I want to update the layer, QFieldSync apparently synchronizes the data, but no changes are made and no errors are logged (similar to @samillar94 ).

When I look at the log files in the geopackage, the log_feature_updates and log_added_features reference layer_id in their attribute table, the value for which is at least 0. Looking at the log_layer_id, the qgis_id value for id=0 is "Trees_Field__offline__9f01cb53_1029_463f_9076_6ace43c0e3eb". If I understand the relations correctly, shouldn't the log_layer_id reference the table being updated, in this case "Trees_Field_bde016a9_22e3_4e6e_aaf5_e7945f43aaf5"? And so the reference to "Trees_Field__offline ..." could be why the updates aren't showing up.

@Mangoesmapping-GeorgeCorea

When I try the Synchronise from QField project, it just re-adds all the tables to the project without the updated data in the edited GPKG. I have set the editable files as offline and they are in a single gpkg with the same projection.

@meyerlor
Copy link

meyerlor commented Nov 4, 2019

I can confirm this behaviour. layer (in gpkg) set by the Syncplugin to offline editable. Added and changed features with Qfield. Syncing back the data with Sync plugin wrote the changed features correctly to the database, but did not add newly created features

(Qfield 1.2, QGIS 3.10, Qfield Sync Plugin 3.1.5)

@rwjdennis
Copy link

@meyerlor That is interesting, because I just updated my project using QFieldSync on the weekend, and only the new features were added, but no existing points were updated. Basically the inverse of what you just described. This was the first time it had happened like that for me, though.

@label-actions
Copy link

label-actions bot commented Nov 6, 2019

Thanks for reporting this bug. Bugs are often fixed on a voluntary basis (see sustainability initiative). This still often takes time and we need to prioritize bugs, so some may slip through the cracks. If you need this bug to be fixed in a more timely manner, get in touch.

@signedav
Copy link
Member

signedav commented Nov 6, 2019

Can you test it with the current master builds here since there has been implementations flushing changes to the geopackage here #694

@nirvn
Copy link
Member

nirvn commented Feb 8, 2021

Fixed, closing.

@nirvn nirvn closed this as completed Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants