Repository navigation
Keep the borewell's own water level when a later reading is added - #82
Merged
Merged
Conversation
…dded Adding a water reading made the newest reading the borewell's current level, so the level recorded with the borewell (form or Excel) was overwritten and the first comparison over time was lost. add_water_reading now saves that level as the first reading (dated with the borewell's date) before adding the new one, unless the new reading is on the same date. Migration 5 does the same once for borewells already saved with no readings.
The e2e reading was dated before the borewell's own date (today), so the kept drilling-time level was rightly the newest. Date it next year and check both levels are kept. Bump rustls for RUSTSEC-2026-0346..0349, published today.
A reading dated next year moved the map's three-year window. Accept any year in the map's 'readings since' note so a run on 31 December passes.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adding the first water reading to a borewell overwrote the water level recorded with it (form or Excel entries keep it only on the borewell row), so a change over time at the same borewell could never be seen. StrataVision's rate-of-change map needs that.
add_water_reading: when the borewell has no readings yet but has a water level and a date, that level (and dynamic level) is saved as its first reading, dated with the borewell's date, in the same transaction. Skipped if the new reading has the same date.NOT EXISTS). Opening the database makes the usual upgrade backup first.Checks:
cargo test(strata_db), clippy-D warnings, typecheck, eslint on app/core/e2e/scripts,npm testall pass.Note for StrataVision: after a release it must take the new schema (version 5), since an older build refuses a newer database.