Skip to content

Refactor selectlist attach feature - #175

Open
LionelZoubritzky-IGN wants to merge 3 commits into
mainfrom
refactor-selectlist-attachFeature
Open

Refactor selectlist attach feature#175
LionelZoubritzky-IGN wants to merge 3 commits into
mainfrom
refactor-selectlist-attachFeature

Conversation

@LionelZoubritzky-IGN

@LionelZoubritzky-IGN LionelZoubritzky-IGN commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Fix two code inconsistencies:

  • 77570a9 merges the two existing implementations of the select: one exists for the GpfGetFeatures codepath and another for GpfGetFeatureById, while they should be identical.
  • d74b22b renames attachFeatureRefs into postProcessFeatureCollection to more accurately reflect that this function handles all the post-processing, and does not only attach feature refs anymore.

Pure refactors, no impact on behavior.

@LionelZoubritzky-IGN LionelZoubritzky-IGN added refactoring Rethink code architecture codefix Fix a small aspect of the code labels Jul 23, 2026
@LionelZoubritzky-IGN
LionelZoubritzky-IGN force-pushed the refactor-selectlist-attachFeature branch from e55fafe to fc26169 Compare July 23, 2026 09:45
Base automatically changed from 160/stateless-proxy to main July 24, 2026 12:37
@LionelZoubritzky-IGN
LionelZoubritzky-IGN force-pushed the refactor-selectlist-attachFeature branch from fc26169 to d74b22b Compare July 24, 2026 13:08
@esgn

esgn commented Jul 27, 2026

Copy link
Copy Markdown
Member

The default parameter geometryProperty = getGeometryProperty(featureType) is evaluated whenever the argument is not provided, even when the geometry is not needed (no select, no spatial_extras). Yet getGeometryProperty throws on a type without any geometry property.

Consequence: a bare gpf_get_feature_by_id on wfs_scot:doc_urba or wfs_scot:doc_urba_com (the 2 geometry-less types in the embedded catalog) now fails before even issuing the WFS request, whereas it worked on main. The old buildPropertyName in byId.ts only resolved the geometry when necessary — that was the invariant documented by the comment removed along with the function.

@LionelZoubritzky-IGN

Copy link
Copy Markdown
Contributor Author

Thank you for catching that regression! Addressed and tested in 25871c3

Additionally, when doing a GetFeatureById with empty select and spatial_extra, the query used to have an empty propertyName, which implies fetching the entire geometry, and then discarding it (and replacing it will null). The refactor already changed that, and the latest commit tests this case. It also add tests for the case of collection without geometries, like wfs_scot:doc_urba.

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

Labels

codefix Fix a small aspect of the code refactoring Rethink code architecture

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants