Repository navigation
fix(map): a streamed layer counts unread dates, <Null> and non-UTF-8 text once for a window read twice (#2615) - #2672
Conversation
…text once for a window read twice (opengeos#2615)
…ty branch in Tally::saw (opengeos#2615)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| /// A window read twice before the notice pass (after a reset) counts its non-UTF-8 text once, not | ||
| /// twice: the notice's "so far" count is what the layer holds. | ||
| #[test] | ||
| fn a_window_read_twice_before_the_notice_pass_counts_once() { |
There was a problem hiding this comment.
This test repeats the setup of a_streamed_shapefile_says_text_that_isnt_utf8_once_and_in_its_exports above (the temp dir and Dir guard, the shapefile write, the .cpg removal, the DBF language byte and AAAAAAA patch, and the layer.addData stream). Pulling that setup into a helper that takes the text to write and returns the session and layer id would keep the two cases from drifting apart. The two tests differ only in when the second read happens relative to the notice pass.
Category: quality
Code reviewBugs
Security
Performance
Quality
AGENTS.md
Known limits, not re-raised
Reviewed: the full diff (3 files), Prior reviews: none existed on this PR, so no earlier concerns were left alone. Change sizeCompared with main (merge base 442ccde to PR head 7327c52).
|
📖 Docs previewCommit |
Summary
A view that read the same window twice before the notice pass (after a
reset, or a definition query change) added that window's unread dates, rounded date-times,<Null>text values and non-UTF-8 text values to the layer's pending counts twice, so the "so far" count in the notice could be higher than the values the layer holds.The four pending counts are now kept per window read (
Tallyincrates/map/src/source.rs): a window read again replaces its counts, and different windows still add up. Both view-read call sites incrates/map/src/lib.rspass the window's extent. The notice wording, and each kind being said once for the opening, are unchanged.Two ceilings remain, both inside the notice's "so far" (it points to Load All Features for the full count):
Memory: a few counters per window read, no layer data. No schema change (the counts aren't saved).
Testing
a_window_read_twice_before_the_notice_pass_counts_once(engine): fails onmain(2 text values counted where the layer holds 1); passes now.a_window_read_again_replaces_its_counts(map): every counted kind (non-UTF-8,<Null>text, unread and rounded dates) read twice in one window counts once, other windows add up, an all-zero re-read clears its window, and the 64-window cap (NaN extents) adds into the overflow. It doesn't compile onmain, as thesaw_*methods take the window now.cargo test -p rustgis-map --lib(451 passed),cargo test -p rustgis-engine streamedandhostile_params, clippy with-D warningson map and engine.origin/main(fb77d77) with this branch and three other branches of mine (fix/2614-dbf-multibyte-notice, fix/2447-terrain-block-keys and fix/2620-qgis-style-read-thread) merged: pre-commit on every file,cargo fmt --check, clippy with-D warnings,cargo test --workspace(8721 passed, 0 failed),cargo xtask layers,cargo xtask schema --checkwith the fixtures checked against the schema and test hygiene,cargo xtask rows, and the Python package's tests (maturin + pytest, 44 passed). 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 #2615
Summary by CodeRabbit