- Shipped
- August 22, 2026 at 5:04 AM UTC
- Author
- Kamo
- Commit
- 4c2b3f9
Opening a document in the LibreOffice editor no longer hands over the original. It derives that document's CLASSIC version — once, reused every time after, and made unrepeatable by a partial unique index — and edits that instead, which is what keeps the Originals tab holding the bytes the member uploaded. POST /api/docs/form-fillable/{id} does the same for the row the Kamo PDF editor opens. Deriving costs nothing until it has to: a new version points at the original's existing ImgDat, and saveImgContent writes a fresh one on the first save, so the copy owns its bytes from the moment it differs and never before. A classic save rebases the form-fillable row onto the new bytes. The fields are addressed by page position and are deliberately NOT moved with them: an edit that reflows pages can misplace them, which is the trade taken over refusing to let a member edit a document they have already put fields on. A failed rebase is logged and swallowed — a stale form-fillable row is still openable, and losing the just-saved classic edit to it would be worse. The session-map-to-KToken mapping now has one implementation rather than one per controller: it decides what clearance a request carries, and two copies are two chances for one to stop reading securityLevel and hand out PUBLIC.