You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(engine): overture.add from a plugin command in the app answers pending, not an empty list (#2677) - #3085
In the desktop app a plugin's command leaves what layer.addUrl would wait for (a GeoParquet's header) to the app, which answers {"pending": true} and adds the layer when it lands. overture.add adds its files through add_files, which kept only each answer's layers, so a plugin got {"layers": [], "files": n} and could not tell it from "no data". A plugin that treats an empty layers as a failure then returns an error, and the call's queued downloads are dropped with it, so the layers never arrive.
The issue says the command is not run again; that is only so for a plugin that errors on the empty answer. A plugin that returns normally was already run again once the files landed (the second test below shows it). So this change does not alter that path: it gives a plugin the signal it was missing, and it was not reproduced against a real plugin.
add_files now adds "pending": true to its answer when any file's answer is pending (layers and files as before), so a plugin handles it as it handles layer.addUrl's: return, and the command runs again once the files are in. The downloads are already registered for that re-run by layer.addUrl (request_url), so nothing else was needed; the re-run is answered from the landed downloads (no lookup by layer name). layer.addUrl's siblings that pass its answer on (portal.add, stac.addAsset, service.add) already pass pending through, and stac.addCube turns it into an error since #2422, so add_files was the one caller that dropped it.
docs/plugins.md and overture.add's parameter description say so. If a later file fails after earlier ones landed, those layers stay (each its own undo step) and the error says how many; the docs say so too.
Kind of change (docs/maintaining.md): a field added to a command's output, which any maintainer may approve. layers and files keep their meaning; no parameter, command, project format or plugin interface change (the command surface snapshot is unchanged).
Surfaces (AGENTS.md "Reach every surface"):
Desktop plugin commands: fixed. Each landed layer is its own undo step, as for layer.addUrl; the call that leaves the files adds nothing and is no step.
Browser: a GeoParquet is not left pending there (it is read from what the app fetched), so unchanged; the change is target independent.
CLI, Python, MCP, the Assistant, scripts and tasks wait for the files and do not get a pending answer; the Overture Maps dialog reads on the frame and does not either. Unchanged.
No ribbon, shortcut, phone or interface text change.
Testing
New overture_files_a_plugin_command_leaves_to_the_app_answer_pending (fails before the change on pending: the answer was {"files":2,"layers":[],...}; passes after). It queues two Overture files through run_leaving_downloads and checks their names; nothing is fetched.
New a_plugin_command_adding_overture_files_runs_again_when_they_are_added: a plugin command's overture.add waits, both files land through the app's download path (GeoParquet bytes made in the test), and the command runs again and answers both layers, added once. This also passes before the change for a plugin that ignores the empty answer; it pins that the re-run works with the new answer.
overture_files_are_added_all_or_none also checks a synchronous add has no pending.
New a_failed_pending_overture_add_says_which_files_stay: when one of the two files fails after the other landed (either order), the error says how many landed and stay, not that none was added. The synchronous path still says none was added (it takes its layers out again). Fails before the change for the bad-file-first order.
cargo test -p rustgis-engine and cargo clippy -p rustgis-engine --all-targets -- -D warnings pass locally.
Not run against Overture's live catalog or a real plugin (BrasilData).
Local gate on origin/main with this branch merged, in an English locale: pre-commit on every file, cargo fmt --check, clippy with -D warnings, cargo xtask layers, cargo xtask schema --check with fixtures and test hygiene, cargo xtask rows, and the Python package's tests (maturin + pytest) all pass. cargo test --workspace passed on one run (and on the one before the last change); on the final head one test fails, layout_title::a_wrapped_map_title_is_sized_for_its_drawn_lines (added by feat(layout): New Layout titles the sheet with {map}, so the title follows a rename of the map #2972), which fails the same way on plain origin/main here and does not touch this change. Not run here: the wasm32 build (no clang on this machine; CI's Web app job checks it), macOS and Windows.
Area files can download asynchronously on desktop. The add command reports that it is pending and runs again after downloads finish.
If a download fails, the error identifies how many files were added earlier; those layers remain available as separate undo steps. Files added in a single run are still added all together or not at all.
The catalog refreshes each time the command runs while its window remains open.
No actionable comments were generated in the recent review.
Walkthrough
The overture.add command now reports pending file additions and handles retries after downloads complete. Multi-file failures report how many earlier downloads remain added. Tests and plugin documentation cover these outcomes.
Changes: Overture plugin additions
Layer / File(s)
Summary
Pending responses and partial failures crates/engine/src/cmd/catalogs.rs
add_files reports pending responses. On multi-file failure, it reports whether earlier files remain added and how many. The parameter documentation describes the pending behavior.
Retry outcomes and documented behavior crates/engine/src/tests.rs, docs/plugins.md
Tests cover pending requests, successful retries, and partial failures. The documentation describes desktop downloads, same-run additions, and catalog fetching while the window is held.
sequenceDiagram
participant PluginCommand
participant add_files
participant layer_add_url as layer::add_url
participant DesktopApp
PluginCommand->>add_files: Call overture.add
add_files->>layer_add_url: Request each file
layer_add_url-->>add_files: Return pending response
add_files-->>PluginCommand: Return pending true
DesktopApp->>PluginCommand: Retry after downloads finish
PluginCommand->>add_files: Run overture.add again
add_files-->>PluginCommand: Return added layer IDs
Loading
Possibly related PRs
opengeos/RustGIS#2905: Addresses the same overture.add pending response behavior for the linked issue.
opengeos/RustGIS#1170: Adds the pending response contract for desktop layer.addUrl downloads used by this flow.
opengeos/RustGIS#1341: Adds plugin command retries after layer.addUrl downloads complete.
Suggested reviewers:giswqs
Merge Risk: Minimal · up to 73f52
overture.add now reports pending: true when files are still downloading, so plugin commands in the desktop app are rerun once the files land. Multi-file failures also say how many files were already added. The change is small and reverts cleanly, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the change: overture.add from a plugin command in the app now answers pending instead of an empty list. The raw summary and objectives confirm that add_files now adds `pending: tru…
Description check
The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains the cause, the fix, and the scope across surfaces. Testing lists new tests and the…
Linked Issues check
Issue #2677 requires that a pending add_url answer from add_files reaches the plugin as "pending": true, with layers and files kept, and that the command runs again when the reads land. The …
Out of Scope Changes check
The whole-PR diff (merge base 23e0f14 to head 73f523c) changes add_files in catalogs.rs, the overture.add parameter description, the Overture tests, and docs/plugins.md. Every code change serv…
Full details: Title check
Explanation
The title names the change: overture.add from a plugin command in the app now answers pending instead of an empty list. The raw summary and objectives confirm that add_files now adds pending: true when a file answer is pending. The title is specific and matches the main change. It uses the conventional fix(engine) prefix and includes the issue number.
Full details: Description check
Explanation
The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains the cause, the fix, and the scope across surfaces. Testing lists new tests and the commands run, and notes one unrelated workspace test failure. UI evidence states 'No visible UI change.' as the template requires. Related issue reads 'Closes #2677'. The description is thorough and complete.
Full details: Linked Issues check
Explanation
Issue #2677 requires that a pending add_url answer from add_files reaches the plugin as "pending": true, with layers and files kept, and that the command runs again when the reads land. The diff to crates/engine/src/cmd/catalogs.rs does this. add_files now sets pending when any file's layer::add_url answer has pending: true, and adds "pending": true to the output only in that case. The synchronous path output is unchanged. The partial-failure error now says how many earlier-landed files remain, which matches the PR description. The PR says the downloads are already registered by layer.addUrl (request_url), so no new registration is added. The issue proposed a lookup by layer name (overture::layer_name) on the second run. The PR instead answers the re-run from landed downloads. The issue's goal of not opening files twice is covered by the test a_plugin_command_adding_overture_files_runs_again_when_they_are_added, which the PR reports checks that layers are added once. I did not read that test. The PR also reports the desktop-path test overture_files_a_plugin_command_leaves_to_the_app_answer_pending. I did not run the tests. Real plugin and live Overture catalog behavior was not tested, as the PR states.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff (merge base 23e0f14 to head 73f523c) changes add_files in catalogs.rs, the overture.add parameter description, the Overture tests, and docs/plugins.md. Every code change serves #2677: the pending pass-through, the rerun test, and the partial-failure error text for pending runs. The parameter description change documents the pending behavior for plugins and does not alter the command's parameters. The PR reports no change to ribbon, interface, project format, or the command surface snapshot. I did not inspect the test and docs hunks, so this verdict rests on the summary and the catalogs.rs diff.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit watched the files take flight, Then saw them land and layers bright. “Pending,” it said, “I’ll wait nearby,” The command ran again beneath the sky. One file stayed; the error made it clear, And every layer kept its undo here.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: 43bfd9d6-eb8b-4cbd-a294-097b17f18af2
Commits
Reviewing files that changed from the base of the PR and between c663b92 and 73f523c.
Files selected for processing: 3
crates/engine/src/cmd/catalogs.rs
crates/engine/src/tests.rs
docs/plugins.md
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
r#"{"theme": "buildings"|"places"|"transportation"|"divisions"|"base"|"addresses", "type"?: "the theme's type (building, building_part; place; segment, connector; division_area, division, division_boundary; land_use, land, land_cover, water, infrastructure, bathymetry; address)", "release"?: "such as 2026-09-23.1 (default: the latest)", "bbox"?: [west, south, east, north] | "view" (the map's extent, the default), "tiles"?: bool (the whole world as map tiles, from the theme's PMTiles archive, instead of the features in view), "files"?: [the files' GeoParquet addresses, when already found and opened (the app's background requests)]}"#,
r#"{"theme": "buildings"|"places"|"transportation"|"divisions"|"base"|"addresses", "type"?: "the theme's type (building, building_part; place; segment, connector; division_area, division, division_boundary; land_use, land, land_cover, water, infrastructure, bathymetry; address)", "release"?: "such as 2026-09-23.1 (default: the latest)", "bbox"?: [west, south, east, north] | "view" (the map's extent, the default), "tiles"?: bool (the whole world as map tiles, from the theme's PMTiles archive, instead of the features in view), "files"?: [the files' GeoParquet addresses, when already found and opened (the app's background requests)]} (in a plugin's command in the app the files are left to download: it answers pending, with the layers already in, and the command runs again once they are added; see docs/plugins.md)"#,
The reason will be displayed to describe this comment to others. Learn more.
This parameter text is the tool description the Assistant and MCP read. The new clause describes a plugin-only answer (pending, then a re-run) that their calls never get, because they wait for the files (run_leaving_downloads is not used on their path). It adds tokens to every Assistant/MCP schema and invites callers to expect a pending they will not see. Suggest keeping this text as it was and documenting the plugin behaviour only in docs/plugins.md, which the PR already does.
Scope: 3 files, +156/−5 lines. The change makes overture.add answer "pending": true when a plugin's command in the desktop app leaves its GeoParquet files to the app. It also adds a more specific error when a later file fails after earlier ones landed. I traced add_files against rerun_landed, Added::added_any/gone, the restore_layers rollback, and the retry_plugin/poll_plugin_retries re-run path. I found no bug in the changed lines.
Bugs
None found. The "landed earlier" count only counts entries that still exist in the map, and the rollback never removes layers from a re-run's own before mark. Both failure orders in a_failed_pending_overture_add_says_which_files_stay are covered. Confidence: medium-high.
Security
None found. The file list is still checked with overture::is_data_file before use. Confidence: high.
Performance
None new. Confidence: high.
Quality
crates/engine/src/cmd/catalogs.rs:14: the new clause in the files parameter text goes into the Assistant and MCP tool schema, but those callers never receive pending. Posted inline. Confidence: medium.
Nit, left for the release quality pass: overture_files_a_plugin_command_leaves_to_the_app_answer_pending (crates/engine/src/tests.rs:37504) calls run_leaving_downloads("overture.add") directly, not through a plugin. The plugin path is covered by the next test. Confidence: high.
AGENTS.md
Pre-existing, not introduced here: the area path of overture.add calls the blocking fetch on desktop (catalogs.rs:53, :89, :102). That is one catalog fetch plus up to MAX_FILES item fetches on the frame, which "Never hold the window" forbids. The new docs sentence at docs/plugins.md:709 acknowledges this, but the code comment at catalogs.rs:186-187 ("the app fetches off the frame") does not hold for a plugin run in the app. The PR does not fix this and I have not posted it inline, since it predates the change. A maintainer should decide whether it gets a fix or a reasoned exemption. Confidence: medium-high.
Twins checked
Multi-file adders: stac.rs:1523 turns pending into an error, and service.rs:1667 handles it. layer.rs:4365 and :4559 add database tables and converted files, not URL requests, so they don't produce a pending answer. I did not trace portal.add or stac.addAsset; the PR body says they pass pending through.
Browser: add_files is target-independent. I did not verify that the browser's layer.addUrl never returns pending for GeoParquet, as the PR body claims.
Prior review threads: none on this PR, so no earlier concerns were left alone.
Change size
Compared with main (merge base 23e0f14 to PR head 73f523c), the whole PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In the desktop app a plugin's command leaves what
layer.addUrlwould wait for (a GeoParquet's header) to the app, which answers{"pending": true}and adds the layer when it lands.overture.addadds its files throughadd_files, which kept only each answer'slayers, so a plugin got{"layers": [], "files": n}and could not tell it from "no data". A plugin that treats an emptylayersas a failure then returns an error, and the call's queued downloads are dropped with it, so the layers never arrive.The issue says the command is not run again; that is only so for a plugin that errors on the empty answer. A plugin that returns normally was already run again once the files landed (the second test below shows it). So this change does not alter that path: it gives a plugin the signal it was missing, and it was not reproduced against a real plugin.
add_filesnow adds"pending": trueto its answer when any file's answer is pending (layersandfilesas before), so a plugin handles it as it handleslayer.addUrl's: return, and the command runs again once the files are in. The downloads are already registered for that re-run bylayer.addUrl(request_url), so nothing else was needed; the re-run is answered from the landed downloads (no lookup by layer name).layer.addUrl's siblings that pass its answer on (portal.add,stac.addAsset,service.add) already passpendingthrough, andstac.addCubeturns it into an error since #2422, soadd_fileswas the one caller that dropped it.docs/plugins.mdandoverture.add's parameter description say so. If a later file fails after earlier ones landed, those layers stay (each its own undo step) and the error says how many; the docs say so too.Kind of change (docs/maintaining.md): a field added to a command's output, which any maintainer may approve.
layersandfileskeep their meaning; no parameter, command, project format or plugin interface change (the command surface snapshot is unchanged).Surfaces (AGENTS.md "Reach every surface"):
layer.addUrl; the call that leaves the files adds nothing and is no step.Testing
overture_files_a_plugin_command_leaves_to_the_app_answer_pending(fails before the change onpending: the answer was{"files":2,"layers":[],...}; passes after). It queues two Overture files throughrun_leaving_downloadsand checks their names; nothing is fetched.a_plugin_command_adding_overture_files_runs_again_when_they_are_added: a plugin command'soverture.addwaits, both files land through the app's download path (GeoParquet bytes made in the test), and the command runs again and answers both layers, added once. This also passes before the change for a plugin that ignores the empty answer; it pins that the re-run works with the new answer.overture_files_are_added_all_or_nonealso checks a synchronous add has nopending.a_failed_pending_overture_add_says_which_files_stay: when one of the two files fails after the other landed (either order), the error says how many landed and stay, not that none was added. The synchronous path still says none was added (it takes its layers out again). Fails before the change for the bad-file-first order.cargo test -p rustgis-engineandcargo clippy -p rustgis-engine --all-targets -- -D warningspass locally.origin/mainwith this branch merged, in an English locale: pre-commit on every file,cargo fmt --check, clippy with-D warnings,cargo xtask layers,cargo xtask schema --checkwith fixtures and test hygiene,cargo xtask rows, and the Python package's tests (maturin + pytest) all pass.cargo test --workspacepassed on one run (and on the one before the last change); on the final head one test fails,layout_title::a_wrapped_map_title_is_sized_for_its_drawn_lines(added by feat(layout): New Layout titles the sheet with {map}, so the title follows a rename of the map #2972), which fails the same way on plainorigin/mainhere and does not touch this change. Not run here: the wasm32 build (no clang on this machine; CI's Web app job checks it), macOS and Windows.UI evidence
No visible UI change.
Related issue
Closes #2677
Summary by CodeRabbit