Skip to content

fix: block saves and mapping starts after configuration read failures - #54

Merged
EvanZhu0721 merged 2 commits into
EvanZhu0721:mainfrom
Nardo021:fix/recover-damaged-config-profiles
Nov 5, 2026
Merged

EvanZhu0721 merged 2 commits into
EvanZhu0721:mainfrom
Nardo021:fix/recover-damaged-config-profiles

Conversation

@Nardo021

@Nardo021 Nardo021 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

When the profile collection cannot be read, geometry edits can clear the original error, and a failed reload leaves the UI accepting actions against stale drafts.

Reuse the existing save-blocked state until a successful reload. Preserve the read error across edits and hydration, block mapping saves, starts, and manual restarts, and keep Stop available. The main panel reports that the configuration is unavailable, and initial read failures are recorded in the existing diagnostics log.

The regression test exercises damaged configuration, blocked edits and saves, failed reload, and successful reload after the file is restored.

Validation:

  • The new regression fails with the previous UI and passes with this patch.
  • cargo fmt --all --check and cargo clippy --locked --all-targets -- -D warnings pass.
  • Rust tests: 139 passed, 26 existing ignored, one native mouse-hook test explicitly skipped.
  • A signed 2.0.2 installer was built and verified locally; no installer or display-mapping test was run on the host.

Plain reset could not load a corrupt config-profiles file, while the UI told users to reset or repair it.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Nardo021
Nardo021 marked this pull request as draft November 3, 2026 01:13
@Nardo021
Nardo021 marked this pull request as ready for review November 3, 2026 01:13
Reuse the existing UI save-blocked state for initial load and reload failures.
Keep the original error visible across edits and hydration, and reject saves,
mapping starts, and manual restarts until a successful reload. Stop remains
available. Record initial read failures in the existing diagnostics log.

Keep the change scoped to this UI failure boundary and its regression coverage.
The profile storage format and command-line interface remain unchanged.

Validation: the regression fails against the previous UI and passes with this
patch; fmt, Clippy, and 139 Rust tests pass (26 ignored and one mouse-hook test
skipped). The signed 2.0.2 installer was built and verified locally.
@EvanZhu0721 EvanZhu0721 changed the title fix: recover a damaged profile collection from an explicit backup fix: block saves and mapping starts after configuration read failures Nov 5, 2026
@EvanZhu0721
EvanZhu0721 merged commit 545d1d7 into EvanZhu0721:main Nov 5, 2026
@EvanZhu0721

Copy link
Copy Markdown
Owner

感谢PR! 不过为了这个Edge Case维护1500+代码的逻辑实在有点重量, 很抱歉不能merge一整套恢复逻辑. 参考你的代码精简了亿下, 保留了配置损坏后的block. 再次感谢贡献!

BTW, 个人觉得让coding agent做对抗性review还是挺危险的.

EvanZhu0721 added a commit that referenced this pull request Nov 5, 2026
Keep configuration read failures visible and block saves and mapping starts until reload succeeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants