Repository navigation
fix(cursor_desktop): support delete on pre-table schemas and KV-only sessions - #57
Adityakk9031 wants to merge 5 commits into
Conversation
|
Deleting |
|
Fixed! Updated \cursorDiskKV\ deletion to match exact session delimiters (%:\ and %::%) so deleting sibling sessions (such as \session-1\ when \session-10\ exists) will not delete other sessions. Added regression test \delete_exact_session_id_does_not_delete_prefixed_sibling\ in \ ests/integration/cursor_desktop.rs. |
|
The delimiter change fixes the
The existing 18 Cursor Desktop tests pass, but this added isolation regression fails. Please escape literal IDs in the |
|
Updated \CursorDesktopStore::delete\ to escape %, _, and \\ characters in the session ID and added an explicit \ESCAPE '\\'\ clause to all \LIKE\ patterns. Added regression test \delete_escapes_like_wildcards_in_session_id\ covering session IDs with _\ and %. |
…delete-schema-compatibility
In
CursorDesktopStore::delete(), the store ran an unconditionalDELETE FROM composerHeaders WHERE composerId = ?1and checked whether any rows were deleted from that table alone.This caused two issues:
composerHeaderstable entirely (whichdiscover()explicitly supports by falling back to scanningcursorDiskKV),delete()failed with a SQLite errorno such table: composerHeaders.composerHeaders, if a session was discovered fromcursorDiskKVwithout an accompanying header entry,delete()cleaned up the KV entries but returnedErr(Error::Malformed("no such session"))becausedeletedfromcomposerHeaderswas 0.This change:
has_table(&conn, "composerHeaders")?before attempting deletion fromcomposerHeaders.Error::Malformedwhen both counts are 0, allowing pre-table databases and KV-only sessions to be deleted cleanly.Testing
delete_roundtrip_removes_session_and_fails_on_duplicate.delete_succeeds_on_database_without_composer_headers_table.delete_succeeds_on_kv_only_session_in_modern_database.cargo test -p txcript --no-default-features --features opencode,hermes,search --test integration cursor_desktop(12/12 passed).cargo clippy -p txcript --no-default-features --features opencode,hermes,search --all-targets -- -D warnings(clean).