[NRT-897] Keep personally protected fields when resetting local changes - #1374
Merged
Conversation
Reset was stripping AnkiHub_Protect tags, so auto-protected edits were discarded. CS confirmed Reset should leave protected fields alone, matching sync. Co-authored-by: Cursor <cursoragent@cursor.com>
…otect_tags=False Keep the strip flag so the old Reset behavior can be restored later without rewriting the reset path. Only the browser call sites change. Co-authored-by: Cursor <cursoragent@cursor.com>
ddevdan
requested changes
Aug 17, 2026
The previous tests still exercised the old True path, and nothing locked the two browser call sites this ticket actually changed. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Addressed both findings:
|
abdnh
previously approved these changes
Aug 17, 2026
Keep a test that still calls strip_personal_protect_tags=True, isolate globally protected Back from a personal tag, and cover AnkiHub_Protect::All. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Addressed the latest review:
|
abdnh
approved these changes
Aug 17, 2026
ddevdan
approved these changes
Aug 17, 2026
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.
Related issues
Proposed changes
Reset local changes was stripping
AnkiHub_Protect::*tags before reimporting, so auto-protected edits (and the protect tag) were discarded. CS confirmed that protected fields should not be affected by Reset — same as a normal sync.This only changes the two browser call sites (
Reset local changeson notes, and reset-all-local-changes for a deck) tostrip_personal_protect_tags=False. The strip flag stays so we can restore the old Reset behavior later without rewriting the reset path. No UI or copy changes.How to reproduce
AnkiHub_Protect::<Field>.Also check:
To actually revert a protected edit: remove the protect tag, then Reset (or use Anki undo).
Screenshots and videos
N/A — no UI changes.
Further comments
NRT-769 made Reset strip personal protect tags so auto-protect wouldn't make Reset a no-op. CS uses Reset as a routine support step and confirmed protected fields should be left alone. Unprotected fields still reset.