mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-28 12:27:11 -06:00
Audit finding 32 (CWE-407): Document_convert rebuilt the whole field list for every id it was given, duplicates included, before deciding whether anything had to move, so one valid id repeated 100,000 times took 18 s on the UI thread (now milliseconds). Ids are deduplicated (a repeated id takes its last note type), all of them are checked against one indexed snapshot before anything moves, already-placed citations are skipped from the snapshot, and the index is rebuilt only after a citation actually moves. The id list is capped at fields::MAX_FIELDS, the most fields Zotero is ever handed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>