Protected field not saving

I’ve noticed that protected fields don’t always save correctly.

For example, NID 1503604372931: I protected the Text field and then added another cloze deletion ({{c4::…}}). Everything was working as expected for the first few months of reviewing the card. However, when I saw the card again today, AnkiHub said that no cloze 4 was found on the card.

I know this cloze was previously there, and I had protected the field, so I’m not sure how it was removed despite being protected. This is easier to notice with clozes because Anki immediately flags that the cloze is missing. For the specific NID above, the Text field was wiped/overwritten, but the Lecture Notes field remained intact.

I’ve noticed similar issues with other cards, affecting both the Text field and Lecture Notes. I suspect Lecture Notes may also be getting overwritten or removed, but this is harder to confirm because changes to Lecture Notes are less obvious during review.

Logs: ankihub_addon_logs_jkogut_1790907388.log

Thinking

Search
Found 0 results for ā€˜tags:official protected field not saving cloze overwritten Lecture Notes category::person_raising_hand: Support order:latest max_posts:10 status:open’

Thanks for the detailed report and for including the NID and logs—that’s very helpful.

From what you described, this is not expected behavior: a field marked as Protected on AnkiHub should not be overwritten by incoming changes from the shared deck, and your locally‑added cloze ({{c4::…}}) should have stayed intact.

A few clarifying questions that will help narrow this down:

  1. Protection status & timing

    • When you protected the Text field for NID 1503604372931, was it:
      • Protected for all notes of that note type on AnkiHub, or
      • Just for your account / local client?
    • Did you ever toggle protection off and back on for that field after adding {{c4::…}}?
  2. Sync pattern

    • Do you regularly sync this profile across multiple devices (e.g., Anki desktop + AnkiMobile/AnkiDroid)?
    • If so, do all devices have the AnkiHub add‑on installed and up to date (for desktop), and are you:
      • Using only one ā€œmainā€ desktop to edit deck content, or
      • Editing on multiple desktops?
  3. Deck & note-type scope

    • Is this NID part of an AnkiHub shared deck where:
      • Other contributors are actively pushing updates?
    • Are there any add-ons installed that modify note fields or clozes (e.g., advanced cloze tools, editor helpers, ā€œcleanā€/auto‑formatting add-ons)?

Things to double‑check on your side

While we investigate, please check the following to help pinpoint the cause:

  1. Confirm the field is currently protected on AnkiHub

    • Open the note on AnkiHub Web (for that NID if possible or that note type).
    • In the note type’s field settings, verify that:
      • Text is still listed as Protected, and
      • If you protect Lecture Notes, confirm that as well.
  2. Check card history in Anki

    • In Anki Desktop, open the note browser, find NID 1503604372931.
    • Look at Browse → Notes → Info (or card Info) to see if:
      • There’s any visible change history or any indication of a recent modification date that might correspond to when the text was wiped.
  3. Confirm if overwrites are happening consistently

    • Identify one or two other notes where you:
      1. Protect Text (and optionally Lecture Notes) on AnkiHub.
      2. Add a new cloze (e.g. {{c5::test}}) or some unique text locally.
      3. Sync with AnkiHub.
      4. Leave it a bit and do a few sync cycles / use another device if you normally do that.
    • See whether the field content gets wiped or stays intact.

If you can reproduce it even once in a small controlled test like this, it gives us a very strong lead that something is off in the protection logic rather than a one‑off edit/sync glitch.


What this most likely means

Based on your description:

  • Text field wiped, Lecture Notes intact:
    • Suggests that Text was treated as unprotected at some sync and got overwritten by an upstream change.
  • You know cloze 4 previously existed and the field was protected:
    • This may indicate a bug in how field protection is applied or stored (e.g., not persisting correctly, or not correctly honored for specific sync operations).
  • The fact you’re seeing similar issues with both fields across multiple cards strongly suggests this is systematic, not user error.

Next steps / how we can proceed

Because you already mentioned ankihub_addon_logs_jkogut_1790907388.log, this is ideal for a dev to inspect. To help the team:

  1. Please confirm in this topic:

    • Your answers to the questions above (devices, timing, how you set protection).
    • Whether you were able to reproduce the issue with a controlled test note.
  2. If you’re comfortable, also share:

    • The name of the AnkiHub deck and note type this NID belongs to.
    • Approximate date/time when you last remember cloze 4 working vs. when you noticed it missing. That helps correlate with log timestamps.

I wasn’t able to find an existing bug report on the community matching ā€œprotected field not saving / clozes removedā€, so this might be:

  • A new bug, or
  • A rare edge case (e.g., multi‑device sync + protection state not syncing or being misapplied).

Given that, I’d recommend treating this as a potential bug report. Once you add the extra details above, I’d expect the AnkiHub team to:

  • Use your logs to look for any ā€œoverwriting protected fieldā€ behavior.
  • Check for any known issues in recent add‑on versions that affect field protection.

If you’d like, I can also suggest a temporary workflow to reduce risk (e.g., duplicating important notes or backing up notes with heavy edits to protected fields) until we confirm what’s going on.

The logs show some unprotected fields getting cleared (such as the Text field in nid:1517723603774), but there’s nothing related to 1503604372931 - it must have been overwritten weeks ago. But there are no signs of protected fields getting overwritten.

Does note 1503604372931 have the AnkiHub_Protect::Text tag now and how did you add it?

1 Like

Yeah, currently the field is unprotected (hence why the card got changed), but it was protected the last time I saw the card, 4 months ago - I’m assuming the logs don’t go back that far.

  • In the old ankihub version I would protect fields by right clicking → protect fields, then click the field.
  • Since the new update I update the field, click off onto a new text box, then verify the protect tag is automatically added to the tag list

Re: nid:1517723603774, that was a recent card I did, didn’t mean to change the text field, so never protected it.

I’ll keep an eye out and see if this happens to other cards and can post an update if I have more examples (theyre just so hard to spot lol)

Thank you for the reply.