Skip to content

Relation slowness and incorrect constraint state in Mergin Maps #4285

@joonaris

Description

@joonaris

When adding data via a relation (parent–child) in Mergin Maps, the UI shows an incorrect validation error for a field with a unique constraint, even though the entered value is actually unique and the feature can be saved successfully.

The issue appears when creating a new related (child) feature from the parent feature using the Relation Editor. The constrained field remains marked as invalid (red / error state), causing confusion. Despite the error indication, Mergin Maps still allows the feature to be saved. Sometimes the validation error goes by

This results in a mismatch between the UI validation state and the actual database constraint enforcement.

Sometimes the constraint warning message disappears after waiting for a short while.
In the Mergin Maps Windows version and in QGIS, everything works smoothly without any noticeable lag.

Image

Environment and Application (+ app version, build, operating system)
Mergin Maps v.2026.1.0
Mergin Maps QGIS plugin version 2025.4.0
QGIS 3.40.10.

Samsung Galaxy A52s
Android 14
On UI-versio 6.1.

Steps to reproduce

  1. Open a Mergin Maps project with a parent–child relation defined.
  2. Ensure the child table has a field (e.g. kohdeluokka --> class) with a unique constraint.
  3. Select a parent feature.
  4. Open the Relation Editor.
  5. Create a new related (child) feature.
  6. Enter a value into the constrained field that is unique.

Actual results

  • The constrained field remains marked as invalid (red / constraint error).
  • The validation error does not disappear, even though the value is unique.
  • Mergin Maps allows saving the feature, despite the UI showing a validation error.
  • UI validation state does not reflect the actual database state

Expected results

  • When a unique value is entered:
    the validation error should disappear immediately
  • UI validation should accurately reflect database constraints.
  • Relation-based editing should not introduce noticeable performance issues.
Mergin_Maps_relation_slowness.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions