Files
wekan/models
Lauri Ojansivu b335c5df07 Attachments: a SHA-256 and plain search text for each, checked on every read, and searched by Filter, Search and Search All Boards.
Every attachment gets its SHA-256 (contentHash: value, size, time) and its
plain search text (with the time it was made) when it is added, and - for
one added before this - the first time it is read whole. Text, Markdown,
CSV, code, JSON, HTML and e-mail are read as text, PDF and Office through
the document extractor, Outlook .msg and OpenDocument from their slideshow
rows. A new attachment's "Added" card history row carries its hash, and so
do the soft delete and restore rows.

Each whole read hashes the bytes on their way out, with no second read: no
stored hash - it is stored; the same - nothing; another hash that the card
history knows - an earlier version an undo or restore brought back - a new
hash and search text are made; anything else - a warning in Admin Panel /
Problems (integrity), keeping the stored hash. A range is no evidence.

Filter's text field, the board's Search and Search All Boards find a card by
its attachments' text; each index row is checked against its live
attachment on that card, and the text is never sent to the browser.

tests/attachmentContent.test.cjs pins the decisions and the wiring;
tests/playwright/specs/attachment-content-search.e2e.js adds a file, finds
it three ways, changes it on disk (warned), reads a range (nothing) and
brings back a known version (accepted, indexed again).

Thanks to xet7 !
2026-11-22 17:37:15 +02:00
..
2026-10-14 13:15:39 +03:00
2026-06-12 20:15:56 +03:00