Repository navigation
fix(engine): require what the layout an import step reads uses (#3496) - #3548
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewI found no bugs, security issues or performance problems. The change makes each save-time check read the layout the same way its command does: Bugs: none found. Security: none found. The new code adds no panics, and Performance: none new. Quality:
AGENTS.md: no breaks found.
Prior review threads: none existed, so none were left alone. Change sizeCompared with the base branch (
|
Summary
A saved
layout.importstep that gave bothdataandtextwasn't checked against the layout it imports: the capability checks readdatafirst, while the command readstext(orpath) and neverdata. The saved project then didn't require what the layout intextuses, so an older version could accept it and drop those settings when the step runs. The same happened with adatathat isn't base64.All the checks read an imported layout through one function,
imported_layout(crates/engine/src/project_capabilities.rs), which now takes the command's id and reads what that command reads:layout.import:textonly.report.existingTemplate: nothing whenlayoutnames a layout (the command reads no file then), elsedatabeforetext, as before.So some steps now require less than before: a
layout.importwhosedataholds a feature itstextdoesn't, areport.existingTemplatethat names a layout and also carries a file, and either with an oversized layout. In each case the command never imports what was being checked.The change is in the engine's check on save, so it reaches the desktop app, the browser, the command line, Python and the Assistant alike. No command, parameter or UI text changes;
docs/maintaining.mdnow says what each of the two commands reads.Testing
a_saved_import_step_requires_what_its_command_reads(crates/engine/src/tests/layout_import_reads.rs), eleven cases, each as a task step and a model step, one through ascript.runline. Before the fix, six of its first nine cases failed; the two oversize cases were added later and failed on the first version of the fix. All pass now.rustgis-cli run --project p.rgis --save out.rgis: onmain(5799813b) thedata+textone saves norequires; with this change both save["layout-legend-column-breaks"].schema --checkandtest-hygienepass; nextest ran 11,929 tests, 11,921 passed. The 8 failures are inrustgis-geolibre(7) and theui-eguismoke testline_strokes_editor_edits_one_class, code this change doesn't touch, and they fail locally on other branches too.test-hygienepass.UI evidence
No visible UI change.
Related issue
Closes #3496
Closes #3482
Summary by CodeRabbit
Bug Fixes
Documentation