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
Calculate Field counts selected rows the layer no longer has in its notices #2838
calculate_field (crates/engine/src/cmd/edit.rs:1597) passes every selected index to evaluate, including ones past the layer's end. Nothing is written to them (original.get(r) at edit.rs:1604), but losses.write counts them: they read as null, so a notice can say "is null in N rows" or list a division by zero for a row that doesn't exist, and {"rows": n} counts them too. Filtering the selection to existing rows fixes both; the rows answer would then change for callers (CLI, Python, MCP). The preview already skips such rows (#2822).
I'll take this one. Calculate Field will evaluate only the selected rows the layer still has, so its notices and its {"rows": n} answer count what it actually wrote, as edit.deleteFeatures already counts only existing rows in {"deleted": n}.
Closing this without a change: the state it describes can't arise in the app. Every path that changes a layer's rows or selection keeps the selection in range:
selecting filters to existing rows and normalizes (select.rs:153-168); loading a project or workspace normalizes too (project.rs:1792, workspace.rs:407);
deleting features takes the selection (edit.rs:705); edits that remove a row shift it (box_edit.rs:269, circle_edit.rs:207); edits that replace a layer's data clear it;
undo and redo swap the whole project, selection included (lib.rs:3679);
re-reading a source maps the selection by feature id (map/src/lib.rs:753, whole.rs:161).
A selection with rows past the layer's end can only be made by setting it directly, so calculate_field's notices and its {"rows": n} answer count rows that exist.
Activity
jgregoriorincon commentedon Nov 24, 2026
I'll take this one. Calculate Field will evaluate only the selected rows the layer still has, so its notices and its
{"rows": n}answer count what it actually wrote, asedit.deleteFeaturesalready counts only existing rows in{"deleted": n}.jgregoriorincon commentedon Nov 24, 2026
Closing this without a change: the state it describes can't arise in the app. Every path that changes a layer's rows or selection keeps the selection in range:
select.rs:153-168); loading a project or workspace normalizes too (project.rs:1792,workspace.rs:407);edit.rs:705); edits that remove a row shift it (box_edit.rs:269,circle_edit.rs:207); edits that replace a layer's data clear it;lib.rs:3679);map/src/lib.rs:753,whole.rs:161).A selection with rows past the layer's end can only be made by setting it directly, so
calculate_field's notices and its{"rows": n}answer count rows that exist.