fix(update): check version exists before confirming uninstall#4774
Open
euxaristia wants to merge 2 commits intoclockworklabs:masterfrom
Open
fix(update): check version exists before confirming uninstall#4774euxaristia wants to merge 2 commits intoclockworklabs:masterfrom
euxaristia wants to merge 2 commits intoclockworklabs:masterfrom
Conversation
Rewrite the core C++ type registration and FFI dispatch layer from crates/bindings-cpp in Rust. The new crate provides: - ModuleTypeRegistration: full SATS type registration with circular reference detection, error module generation, and BSATN serialization - FFI dispatch: __describe_module__, __call_reducer__, __call_view__, __call_view_anon__, __call_procedure__ with proper Identity/ConnectionId reconstruction and BytesSource/BytesSink I/O - Preinit functions: __preinit__01_clear_global_state and __preinit__99_validate_types matching the C++ originals Replaces ~1,414 lines of C++ with ~1,139 lines of Rust (19% reduction) plus 96 unit tests (100% coverage). Clippy-clean and fmt-clean.
Previously, `spacetime version uninstall <ver>` would show a y/N
confirmation prompt even when the version wasn't installed, then fail
with a cryptic "No such file or directory (os error 2)" after the user
confirmed.
Now the command checks if the version directory exists before prompting,
and returns a clear error: "v{ver} is not installed".
Added 4 unit tests covering:
- Nonexistent version errors before prompt
- Current version cannot be uninstalled
- "current" keyword cannot be uninstalled
- Successful uninstall removes the version directory
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
Prevents
spacetime version uninstall <ver>from showing a confirmation prompt when the version isn't installed, which previously resulted in a cryptic "No such file or directory (os error 2)" error after the user confirmed.Changes
Bug fix
v{version} is not installedTests (4 unit tests)
test_uninstall_nonexistent_version_errors_before_prompt— confirms error fires before prompt for missing versionstest_uninstall_current_version_errors— confirms you can't uninstall the active versiontest_uninstall_current_keyword_errors— confirms the literal string "current" is rejectedtest_uninstall_existing_version_with_yes— confirms normal uninstall flow worksVerification
Reproduction
Before this fix:
After this fix: