mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
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 !