Explain deletions

AnkiWeb addon 12287769

1 other version of this addon exists. Compare versions ↓

Logs note deletions with their reasons and times in CSV format to help debug unexpected card or note removal.
AI-generated summary; may contain mistakes.

developer-toolsobsolete

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
3 (πŸ‘ 3 Β· πŸ‘Ž 0)
Updated
2019-06-24
Anki versions
unknown
License
GPL-3.0 (from the license file in the package)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, Batchfile
Description language
en

Maintenance

abandoned

  • Last update or commit: 2020-08-02 (2282 days before the snapshot).
  • Commits in the last year: 0.
  • Issues: 0 open, 2 closed.
  • Pull requests: 0 open, 0 merged.
  • Median first response: 3 hours (2 answered issues and pull requests).
  • Forks that may still be maintained: "Explain deletions Fixed (Excluir decks)" (1835825873).

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.0–2019-06-24
History across monthly snapshots

Loading…

Compare versions

The original addon and its forks. The best value in each column is in bold.

VersionWorks on Anki 26.09.3MaintenanceLast activity VotesApprovalGitHub starsNotes
Explain deletions this addon original unknown abandoned 2 Aug 2020 πŸ‘ 3 Β· πŸ‘Ž 0 44% 1 obsolete
↳ Explain deletions Fixed (Excluir decks) (AI-detected; may be wrong) likely abandoned 28 Oct 2024 πŸ‘ 0 Β· πŸ‘Ž 0 – –

Forks can add features or work in a different way. Read the description before you change to another version. Fork detection is incomplete, so other versions can exist.

Similar addons

Zzz (legacy) No Sound Debug

Helps debug missing audio by configuring mpv to write a log file, preventing restarts from creating new logs, and guiding users to inspect or share that log.

bugfix-workarounddeveloper-tools

2 votes 34% approval πŸ‘ 2 Β· πŸ‘Ž 0 Anki 2.1.30~ Updated 2020-08-20
CSV Import Plus

Imports CSV or pasted text into Anki with auto-detected delimiters and note types, searchable deck selection, quick imports, subdeck creation, tag handling, and session history browsing or deletion.

card-creationimporttaggingdeck-management

8 votes 53% approval πŸ‘ 7 Β· πŸ‘Ž 1 ⭐ 1 Anki 25.09.4~ Updated 2026-10-22
export cards/notes from browser with metadata to csv or xlsx

Exports selected browser cards or notes, including visible columns, field HTML, and metadata such as interval and due dates, to CSV or XLSX, optionally using configurable field sets.

export

37 votes 82% approval πŸ‘ 35 Β· πŸ‘Ž 2 Anki 24.04~ Updated 2024-03-28
Show HTML fields of a note

Displays the raw HTML of every field in a note, helping users debug cards that show unexpected or strange content.

developer-tools

4 votes 30% approval πŸ‘ 3 Β· πŸ‘Ž 1 ⭐ 2 Updated 2018-08-20
GachAnki

Adds a Genshin Impact-style gacha system where answering cards Good or Easy earns points to roll for characters and weapons, with pity guarantees.

gamificationmotivationbeta

1 votes 0% approval πŸ‘ 0 Β· πŸ‘Ž 1 ⭐ 1 Anki 23.12.1~ Updated 2024-09-09

Description

README

Explaining deletion

Rationale

Sometime, you have bugs. Card or notes are deleted, and you just don't know why. You can find the notes in the file deleted.txt, at least if you are lucky, and that the deletion was clean enough to be logged.

However, when you want to know why the problem did occur, you miss two important facts. The time of the deletion. And its reason.

Furthermore, the same separator (tab) is used for separating the fields's content, and separating the fields content from the main column. This does not help readability.

This add-on logs everything in CSV format, which is non-ambiguous (as long as you know the note type)

Usage

All kinds of deletions

When this add-on is installed, when a note is deleted, it will be logged in deleted_long.txt instead of deleted.txt. The reason will be logged. Currently, there may be three kinds of reason:

You actually asked to delete a whole not. It can appear in the following cases:

  • "Deletion of note {id} requested from the reviewer." While reviewing card, you pressed on Β«deleteΒ».
  • "Deletion of notes {nids} requested from the browser" In the browser, you pressed on delete.
  • "Temporary note" (i.e. you started to create a note, and then decided you don't want to save it)
  • "Remove cards/notes from grave, after sync." This may occur during synchronization. I'm not sure when it actually occurs.
  • "Removing notes {ids} with missing note type" For some reason, you had a note and anki does not have any idea how to represent it. Instead of telling you something REALLY wrong occured, and giving you the data to save it, anki silently delete all of this. Pretty bad, isn't it ? I sadly have no solution, it would require a big and complicated add-on to fix it. So my best right now is to at least let you kow in the deletion file.
  • "Note {ids} with no cards" It may occur that a not have no cards anymore. For example if you empty all of its fields. Or at least, that there are so little fields used that no cards can be generated. Once again, instead of letting you correct this error, anki silently delete the note. You'll be able to find when this happen thanks to this add-on. At least, if you go in the deleted file. Sorry that I can't do better.

You may also decide to delete cards, realize that this lead no card to some note, and thus deleted the note. It may occur in the following cases:

  • "Cards {ids} removed because of missing templates." Similar to last case, but instead of a whole note missing, a single template of a card is missing.
  • "Deleting cards {cids} because we delete the model {m}". A model is being deleted. You probably was warned that it still had some notes, and agreed to have it deleted. Thus here it is.
  • "Removing card type {template} from model {m}" Similarly to last case, but this case with card type.
  • "Removing cards {cids} because its deck {did} is deleted" Once again, it's similar, but with deck deletion.
  • "Changing notes {nids} from model {oldModel} to {newModel}, leading to deletion of {deleted}" Changing the note type of a note is essentially creating a new note and deleting the old one. Kind of. Anyway, it leads to card deletion, and there it is.

Finally, it may also occur that we have no clue why the deletion occured. It was probably an add-on request, thus the current add-on can't control it. This is thus the best error message that I can offer.

  • "Card {ids} removed, no card remained, so note also removed." Anki was asked to remove cards, but not for any previously listed reason.
  • "Removing notes {ids}" Similarly to last case, this just means that we have no informations more precise to give.

Warning

It is highly probable that this add-on will be incompatible with other add-ons. Because it changes a lot of things. Sadly, it seems hard to do really better. Please let me know whether you find some problem, with which add-on you have those problem. It means that this add-on may be better for debugging purpose than for every day use. I'm not sur.

In particular it is incompatible with add-ons:

Please instead use-addon 777545149 which merges those three add-ons

Internal

This add-on redefine the following methods:

  • In anki.collection: _Collection._remNotes, _Collection.fixIntegrity, _Collection.remCards, remNotes,
  • In aqt.AddCards: AddCards.removeTempNote,
  • In anki.sync: Syncer.remove,
  • In anki.models: ModelManager.rem, ModelManager.remTemplate, _changeCards
  • In anki.decks: DeckManager.rem
  • In aqt.reviewer: Reviewer.onDelet
  • In aqt.browser: Browser._deleteNotes
  • In aqt.main: AnkiQt.BackupThread.onRemNotes

Version 2.0

It won't be updated. It add only a single more column, with the reason. And it's less precise. It also only update _Collection._remNotes and the methods calling it, this _Collection._remNotes, i.e. _Collection.remCards, _Collection.fixIntegrity, Syncer.remove and AddCards.removeTempNote.

Todo

May be allow to use configuration to decide which note to use, which method to redefine.

Links, licence and credits

Key Value
Copyright Arthur Milchior arthur@milchior.fr
Based on Anki code by Damien Elmes anki@ichi2.net
License GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
Source in https://github.com/Arthur-Milchior/anki-note-deletion
Addon number 12287769