Repository navigation
fix(engine): a service read by address is re-added from Recent page by page - #3025
Conversation
…y page (opengeos#2553) A layer added with layer.addUrl or layer.addDownload and "service": true is read page by page, but Recent kept only its address, name and layer. Adding it again from the Data Sources pane ran ui.addUrl without the flag, so the read stopped at the server's first page. Recent now keeps "service": "true" in the source's extra for such an add, sources.list says to add it with layer.addUrl {url, service: true}, and the pane passes the flag back. Add From Service feature layers, Web Data's FEMA NFHL Features button and Open Data feature results all add this way.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewReviewed the four changed files against Finding placement: 2 inline comments are buffered for posting (one bug, one nit group). Bugs
Security
Performance
Quality
AGENTS.md
Twins checked
Change sizeCompared with main (merge base db58210 to PR head a697a32). Files changed: 4 (0 added, 4 modified, 0 removed, 0 renamed).
|
📖 Docs previewCommit |
…was asked in (opengeos#2553) A coverage added with layer.addUrl or layer.addDownload and "coverage": true was kept in Recent as a plain address, without the flag or its coverageCrs. Adding it again from the Data Sources pane read the GetCoverage address as an ordinary download, not in the system it was asked in. Recent now keeps "coverage" and, with it, "coverageCrs" in the source's extra, as it keeps "service"; sources.list names them in addWith, and the pane passes them back to ui.addUrl, which forwards both to layer.addDownload. Source::flag reads a kept flag, so its spelling lives in one place, and the sources.save description lists the three keys.
| impl Source { | ||
| /// Whether the add this source records had `flag` (one of [`URL_FLAGS`]). | ||
| pub fn flag(&self, flag: &str) -> bool { | ||
| self.extra.get(flag).and_then(Value::as_str) == Some(FLAG_ON) |
There was a problem hiding this comment.
flag reads only the string "true", which is the form sources.save documents. clean() drops any non-string extra value without a notice, so a caller that writes JSON "extra": {"service": true} is saved as a plain address and its re-add reads only the first page, with no message. The documented form works, so this is quality rather than a bug. If JSON booleans should be accepted too, the fix is small: read the flag with bool_value here and have clean() keep a boolean URL_FLAGS key as "true". I didn't check whether sources.save notifies about dropped keys.
Category: quality
There was a problem hiding this comment.
I'll leave this as is. extra is documented and cleaned as a map of strings, and accepting booleans would widen what sources.save takes, which is outside #2553.
Code reviewScope: PR #3025, "a service read by address is re-added from Recent page by page". It keeps the Bugs
Security
Performance
Quality
AGENTS.md
Prior threads
Change sizeCompared with
|
…engeos#2553) A url source saved with sources.save and only "coverageCrs" in its extra got the hint layer.addUrl {url, coverageCrs}, though layer.addUrl reads a coverageCrs only with "coverage": true. The hint now names it only beside the coverage flag, as added_by keeps it.
Code reviewBugs
Security
Performance
Quality
AGENTS.md
Checked, no finding
Change sizeCompared with
|
…engeos#2553) sourcespane::open passed a source's coverageCrs to ui.addUrl even without "coverage", unlike added_by and add_with. It now passes it only beside the flag. No behaviour changes: add_url ignores coverageCrs without coverage, so there is no new test.
Code reviewI found no bugs, security problems, or performance issues in this PR. I posted no inline comments: the two quality points below are minor, so they're grouped here. I checked the new flag path end to end: Bugs: none found. Confidence: high. Security: none found. The flags are fixed strings, and Performance: none found. Quality:
AGENTS.md: no breaks found. Twins checked:
Earlier review threads on this PR: five. I left all five alone. The JSON-boolean suggestion was declined by the author, and the other four were fixed and resolved. Change sizeCompared with the base branch (merge base db58210 to PR head da4b5c8).
|
Summary
A layer added with
layer.addUrlorlayer.addDownloadand"service": trueis read page by page, but Recent kept only its address, name and layer. Adding it again from the Data Sources pane ranui.addUrlwithout the flag, so the read stopped at the server's first page with no notice. A WCS coverage added with"coverage": truehad the same gap: Recent dropped the flag and itscoverageCrs, so a re-add read the GetCoverage address as an ordinary address, not as a coverage in the system it was asked in.This keeps
"service": "true", or"coverage": "true"with itscoverageCrs, in the source'sextrawhen the add had them (sources::added_by).sourcespane::openpasses them back toui.addUrl, which forwards all three tolayer.addDownload, andsources.listgivesaddWithaslayer.addUrl {url, service: true}orlayer.addUrl {url, coverage: true, coverageCrs}.Source::flagreads a kept flag, so its spelling lives in one place, and thesources.savedescription lists the three keys.extrastays a small object of strings, assources::cleankeeps it. An older RustGIS keeps the keys when it reads and saves these sources, and adds such a source as a plain address, as it does today. A plain URL add keeps only its layer, as before.Add From Service feature layers (
serviceui.rs), the FEMA NFHL Features button in Web Data (webdataui.rs) and Open Data feature results (opendataui.rs) all go throughui.addUrlwith"service": true, which passes the flag on tolayer.addDownload, so this covers all three. It's the follow-up #2547 mentioned. The app's coverage add (From Service, WCS) goes throughui.addUrlwith"coverage": trueandcoverageCrstoo.Surfaces: the Data Sources pane on the desktop and in the web app, which share
sourcespane::openand theui.addUrlpaged read (built for wasm, not run in a browser); the command line, Python, the Assistant and MCP throughsources.list'saddWith, where Recent lasts for the session. The phone interface has no Data Sources pane. No command or parameter was added, so the ribbon, shortcuts and command search are unchanged. A re-added layer is undone or removed like any other.Not covered, as before: Recent doesn't keep the layer's
bounds, so a re-add skips the axis check against them (#1053). It doesn't keep theconnectionan add named either; a re-add finds the login by the address's origin (a session login, the one selected for that origin, or the only saved connection for it), so a source whose origin has several saved connections and none selected may be read without a login. Entries recorded before this change have no flag until the source is added again.Testing
sourcespane::tests::a_service_read_by_address_is_read_in_pages_again_from_recent(ui-egui): adds a two-page OGC API items address as a service, then adds it again from Recent and checks the second layer has both pages. With theopenchange removed it fails (left: 1, right: 2, no second layer from a paged read); with theadded_bychange removed it fails the same way.sourcespane::tests::a_coverage_is_added_again_from_recent_in_the_system_it_was_asked_in(ui-egui): records a coverage download throughadded_byandclean, opens it from Recent and checks the download it starts hascoverage: trueandcoverageCrs: "EPSG:2056". It fails with either half of the coverage change removed (left: None: the address is probed as a plain one and no coverage download starts).a_service_query_added_by_address_is_read_in_pages_without_the_appanda_coverage_answer_without_its_system_is_read_in_the_one_asked_for(engine) now also check the Recent entry'sextraandaddWith; each fails without itsadded_bychange. The coverage test also saves a source with onlycoverageCrsand checks itsaddWithislayer.addUrl {url}; it fails without the coverage gate inadd_with.sources::testschecksadded_bykeeps the flags throughclean, keeps nothing for"service": falseand nocoverageCrswithoutcoverage.cargo clippy -p rustgis-engine -p rustgis-ui-egui --all-targets -- -D warningspass.cargo test -p rustgis-engine -p rustgis-ui-egui --libpasses excepttests::layout_title::a_wrapped_map_title_is_sized_for_its_drawn_lines, which fails the same way onmain(db58210) on this machine (macOS). The first commit also rancargo test --workspace --no-fail-fastwith the same single failure.cargo xtask layers,cargo xtask test-hygiene,cargo xtask commands(no change tocommand-surface.txt).RUSTFLAGS='-D warnings' cargo build --locked --target wasm32-unknown-unknown -p rustgis-web.UI evidence
No visible UI change.
Related issue
Closes #2553
Summary by CodeRabbit
Bug Fixes
Documentation