Repository navigation
fix(settings): keep saved sources, plugin state and sign-ins a newer RustGIS wrote - #1962
Merged
Mavrick-F merged 17 commits intoNov 14, 2026
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 rewrites saved data sources, plugin state or the ChatGPT sign-in store without what it couldn't read. Each now keeps what it can't read unchanged, or refuses to write over it. This follows the contract in docs/maintaining.md › Saved files and settings.
data_sources(favourites, recent, saved)plugins/state.json(desktop)load_installed, which then loads no plugins (a disabled one may be a native program), naming the file and saying repairing or removing it brings them back. Writes are refused with an actionable error. Unknown keys are kept.plugins_web(browser)versionwas ignored. A store from a newer RustGIS was rewritten as version 2.Notes:
crates/plugins/src/store.rs, only inuninstall. This PR changesState,read_state,write_stateandload_installed, so the two merge independently. Once both land,uninstallrefuses before it erases a plugin's settings whilestate.jsoncan't be read, because thewrite_stateit calls first returns the error.data_sourcesandplugins/state.jsoncarry no version, so what is kept unchanged is the rows and fields this version doesn't know and a file it can't read as a whole (which is never written over); a newer version that changed what a known field means is not detected here, and adding a version marker to these files is a format decision. The documented promise is that these lists hold no secrets. Within the shape this RustGIS reads it knows that promise, so it can tell a secret and drop it; text it can't parse it can't interpret, so that is kept byte for byte and never rewritten.cleanchanges are counted and reported too.extraobject of a saved source is still cleaned (string values, at most 8 keys, no secret-looking keys). That filtering is a safety measure, and loosening it is a separate decision.Testing
sources::tests::sources_keep_what_this_version_cannot_read: an unknown kind, unknown fields and an unknown list survivenoteandkeep. Fields go with a source that ages out of Recent or is forgotten. Rows past a list's limit are kept and reported as such. Two unreadable shapes are kept byte for byte. Data holding a secret is dropped and said. Clean input gives no notice.smoke::saved_sources_from_a_newer_version_survive_recording_a_recent_one: in the app, adding a GeoJSON file records it as recent and saves it ahead of the kept rows and fields. A preference that isn't an object stays byte for byte.tests::plugin_state_keeps_what_this_version_cannot_read(plugins): an unknown key survives a disable. Two unreadablestate.jsonshapes are reported at load with no plugin loaded, refuse enable and uninstall, and stay byte for byte; a missing file loads as before with no notice.pluginsui::tests::saved_web_plugins_keep_what_this_version_cannot_read: an unknown field and an unreadable entry survive a change. A preference that isn't a list isn't read.chatgpt::…::a_store_from_a_newer_version_is_kept_as_it_is: a version-3 store refuses read, sign-in, sign-out and removal, and stays byte for byte.cargo fmt --check, the tests above, the existing sources and chatgpt tests,cargo clippy -D warningsandcargo check --target wasm32-unknown-unknownfor engine, plugins, assistant and ui-egui. The full CI (fork run) passed on this head.Merge danger: a two-way door. The blast radius is saved settings: a setting that was silently emptied before is now kept, and a write to it is refused or held for the session.
UI evidence
No visible UI change.
Related issue
Part of #1405 item 3 (saved sources, plugin installation state, account store). Connections are in #1945.
🤖 Generated with Claude Code
Summary by CodeRabbit