Bug report #20865
attributes in attribute table don't match attribute in identify results/labels with WFS layer
|Category:||Web Services clients/WFS|
|Affected QGIS version:||3.5(master)||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||28684|
Using the WFS Layer "Netzknoten/Nullpunkte" on the http://inspire.brandenburg.de/services/strassennetz_wfs WFS service, I encounter a very strange problem.
When I graphically select a feature, the attributes shown for the highlighted feature in the attribute table do not match the attributes shown in the indentify results for that features, or the label that's (correctly) displaying one of the attributes. It's as if the attribute table shows completely wrong data for the selected features. Is this a problem with the WFS server or with QGIS?
[WFS provider] Ensure stability of QGIS FeatureId when reloading layer (fixes #20865)
#2 Updated by Alessandro Pasotti over 2 years ago
Ok, this is what's happening (and it isn't good news):
- wfs keeps a spatialite cache of features that map QGIS feature ids to gml feature ids
- any time the layer is reloaded the cache is recreated and the QGIS feature id <-> gml id map changes
- when the attribute table is opened in dock mode (and populated), the QGIS application issues a canvas refresh, which in turn triggers a WFS layer reload
So, we end up with a table which was populated with data that came from a cache that has been destroyed
The root of all evil is that there are no stable feature ids from WFS.