#67474·QGIS

Feature rejected by the database is regarded as saved and lost with toggling edit mode

Author: thunwalCreated Sep 17, 2026Updated Sep 17, 2026
LabelsBug
### What is the bug or the crash? **Summary** A new feature rejected by the database is regarded as saved and discarded without warning when toggling edit mode. This only affects the transaction mode "Buffered Transaction Groups". **Detail** If a new feature breaks a constraint in the database and the user clicks "Save layer edits", QGIS acts as if the save had worked. The error message from the database is shown in the message bar, but: - no "Commit Errors" dialog appears ("Could not commit changes to layer...") - the feature is still drawn on the map - "Save layer edits" is disabled and the layer is no longer marked as modified If you now toggle edit mode, the feature silently disappears. **Expected behaviour** The same as with the local edit buffer: - "Commit Errors" dialog appears ("Could not commit changes to layer...") - The edit buffer is kept ### Steps to reproduce the issue Tested using a GeoPackage with a point layer and a UNIQUE Constraint on one of the fields. 1. Configure your project to use "Buffered Transaction Groups". 3. Toggle editing on. 4. Add a feature, save. Copy the feature, save. 5. The DB reports the constraint violation, "Save layer edits" is disabled, the layer is no longer marked as modified. 6. Toggle editing off. 7. The feature silently disappears. Variant: Skip step 4 (save). QGIS will prompt you to save in step 6 (toggle editing). ### Versions I also reproduced this issue using 3.40.9.
QGIS-Version4.2.1-Belém do Pará
QGIS-Codeversionf229b86a9c1
 
Bibliotheken
Qt-Version6.11.1
Python-Version3.12.13
GDAL-Version3.13.2 — Iowa City
PROJ-Version9.8.1
EPSG-Registraturdatenbankversion ()
GEOS-Version3.14.1-CAPI-1.20.5
SFCGAL-Version2.3.0
GeographicLib-Version2.7.0
SQLite-Version3.53.4
PDAL-Version2.10.0
PostgreSQL-Client-Version18.4
SpatiaLite-Version5.1.0
QWT-Version6.3.0
QScintilla2-Version2.14.1
OpenGL-Version4.3 (Kompatibilitätsprofil), Intel(R) Iris(R) Xe Graphics
BS-VersionWindows 11 Version 24H2
 
Aktive Python-Erweiterungen
QgisModelBakerv8.3.10
db_manager0.1.20
linking_relation_editorv1.5.0
processing2.12.99
solocator2.0.0
### Supported QGIS version - [x] I'm running a supported QGIS version according to [the roadmap](https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule). ### New profile - [x] I tried with a new [QGIS profile](https://docs.qgis.org/latest/en/docs/user_manual/introduction/qgis_configuration.html#working-with-user-profiles) ### No Duplicate of the Issue - [x] I have verified that there are no existing issues raised related to my problem. ### Additional context _No response_