Skip to content

Feature count in QGIS Layer Tree is not refreshed after successful Mergin Maps sync #941

Description

@MF-Aichinger

Description

After synchronising a Mergin Maps project from the field back to QGIS Desktop, the synchronisation completes successfully and the new/changed features are correctly written to the local GeoPackage.

However, the feature count displayed in the QGIS Layer Tree is not updated automatically.

The layer still shows the old number of features in the Layer Tree, even though the underlying data has already been successfully synchronised and the new features are visible/available in the layer.

The feature count is only updated after closing and reopening the QGIS project.

Steps to reproduce

  1. Open a QGIS project containing a Mergin Maps project/layer.
  2. Synchronise the project with Mergin Maps.
  3. Collect or create additional features in the Mergin Maps mobile app.
  4. Synchronise the mobile project back to Mergin Maps.
  5. In QGIS Desktop, synchronise/pull the changes using the Mergin Maps QGIS plugin.
  6. Wait until the synchronisation completes successfully.
  7. Look at the feature count displayed next to the layer in the QGIS Layer Tree.

Expected behaviour

After a successful synchronisation, the feature count in the QGIS Layer Tree should be refreshed automatically and show the current number of features in the layer.

For example:

Before sync:
Schacht (150)

After synchronisation with 10 new features:
Schacht (160)

Actual behaviour

The synchronisation completes successfully and the data is updated, but the Layer Tree still displays:

Schacht (150)

The count remains unchanged until the QGIS project is closed and reopened.

After reopening the project, the correct count is displayed:

Schacht (160)

Additional information

The problem appears to be limited to the displayed feature count in the QGIS Layer Tree. The synchronised data itself is correct.

This is particularly noticeable in field workflows where the Layer Tree is used to quickly monitor the number of collected objects.

Environment

  • QGIS: [version]
  • Mergin Maps QGIS Plugin: [since 3.28]
  • Operating system: [Windows]

The issue can be reproduced consistently after synchronising newly created features from Mergin Maps mobile to QGIS Desktop.

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions