-
Notifications
You must be signed in to change notification settings - Fork 18
Description
When the project is synced, the feature count is not updated. This can be misleading for users who display the feature count next to the layers in the Layers panel. Moreover, we use this feature count in a validation when there is a relation. Users are warned about bad relation setup, which is really confusing.
Reloading the project after sync might solve all these issues. 🤞
From the discussion:
The key line in plugin is this:
feature_count = layer.dataProvider().featureCount()
for f in fields:
if len(layer.uniqueValues(f)) != feature_count
And the issue is that when you sync changes from the mobile app in QGIS, the feature count from the provider (gpkg) is not updated. It causes a mismatch, resulting in the misleading warning. When you restart QGIS, the feature count is correctly updated, and the warning is gone. This validation is run only when relations are set up in the project.
If you change the number of features in QGIS the feature count is recalculated immediately.
