Repository navigation
fix(engine): keep saved connections a newer RustGIS wrote instead of dropping them - #1945
Merged
Merged
Conversation
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.
Summary
An older RustGIS no longer drops saved connections it can't read when it saves the
connectionspreference again. Before,Connections::from_jsonignored the storedversion, skipped rows it couldn't read, and lost fields it didn't know (the login fields of #1223 already, for a 0.5 client). Any later edit, or a login that records a remembered password, rewrote the list without them.connectionskey is the deliberate trade for a file that may come from a newer RustGIS, and the notice says what to do.Testing
connections::tests::connections_keep_rows_and_fields_this_version_cannot_read: an unknown kind, anullrow, an unknown field and an unknown top-level key survive an add and a rename. The new id skips the kept row'sc7. Removing a connection removes its unknown fields.connections::tests::connections_from_a_newer_version_or_unreadable_are_kept_whole: version 2, a non-object, a non-integer version and a non-array list are each reported once, refuse adding with that reason, and come back byte for byte. Clean input gives no notice.smoke::connections_from_a_newer_version_survive_other_changes: through the app's real preference load and save, recording a recent source, favouriting a source andconnection.newleave a version-2 preference byte for byte. With a version-1 preference, the unknown row and field survive the add.cargo fmt --check,cargo test -p rustgis-engine --lib connection, the smoke tests above,cargo clippy -p rustgis-engine -p rustgis-ui-egui --all-targets -D warnings,cargo check --target wasm32-unknown-unknownfor both crates. The full CI (fork run) passed on this head.Merge danger: a two-way door. The blast radius is saved connections: a preference that was silently emptied before is now kept and not used, with a notice.
UI evidence
No visible UI change.
Related issue
Part of #1405 item 3 (connections). Saved sources, plugin state and the sign-in store follow in a separate PR.
🤖 Generated with Claude Code
Summary by CodeRabbit