Repository navigation
add_docs: OnDeletedId='restore' to re-add a retired document id - #110
Merged
Merged
Conversation
Mirrors the DID-matlab change of the same name. A document id retired by removal from every branch is refused by default as before; with OnDeletedId='restore' it is un-retired inside the add's transaction (so a failed add leaves it retired) and the document is added fresh. For the same document coming back, e.g. NDI re-downloading from the cloud a document deleted locally (VH-Lab/NDI-matlab#1238). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011v7R5vMg5Qz8W7zUb26wM2
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
Mirrors the DID-matlab change of the same name, for VH-Lab/NDI-matlab#1238 (a cloud mirror fails after a local delete because the document's id is retired).
add_docs(..., OnDeletedId="error" | "restore"), validated up front likeOnDuplicate; forwarded to_do_add_doconly when not the default.SQLiteDB._do_add_doc,"restore"deletes the id fromdeleted_docsinside the add'stryblock, so a failed add rolls the un-retirement back with everything else.Testing
tests/test_document_reclamation.py: restore works and un-retires the id, a re-removal retires it again, a failed restore leaves the id retired, and an invalid value is rejected.blackandruff(CI-pinned versions) are clean.Generated by Claude Code