Open Djedouas opened 3 months ago
The short answer is that it's not supposed to work. As soon as you make a feature source it's independent from the layer and won't pick up changes to the layer. The only reason it works for the other formats is because there's the backend storage getting altered and the modification are being done outside of the whole QgsVectorLayer world.
The API is designed to require you to make the feature source after changing the layer.
Thanks @nyalldawson for this explanation.
Here is a video illustrating the problem, that the geometry checker plugin does not work properly with memory layers (and thus blocking me from continuing https://github.com/qgis/QGIS-Enhancement-Proposals/issues/236):
Memory layer: only one vertex removed, the original geometry is always taken on each vertex deletion iteration
GPKG layer: all the vertices are removed, the iteration on the geometry is correct
https://github.com/user-attachments/assets/374152db-ceeb-421f-8fb3-7cb07d485125
What is the bug or the crash?
While (still) working on https://github.com/qgis/QGIS-Enhancement-Proposals/issues/236 (porting the geometry checker to the processing toolbox), I stumbled across an incredibly specific bug, which took me days to understand that it was a bug, and days to try to find it...
I need help understanding the bug, and fixing it.
Trying to explain it simply: there is a difference when working with temporary layers VS working with other providers (GPKG in this example).
Steps to reproduce the issue
The simple test with memory layer:
The test with memory and GPKG layer showing that GPKG does not fail whereas memory does:
The CPP test:
Versions
master and LTR 3.34.8
Supported QGIS version
New profile
Additional context
Any help is welcome, I need to know if it's supposed to work as it works with memory or ogr provider, and advices on how to fix it, or point code locations...
Thank you.