| 5a285deb | 06-Jul-2026 |
Andreas Gohr <gohr@cosmocode.de> |
fix(changelog): stop media mtime bumps from recording bogus external edits
Commit 01e8d739c ("persist external-edit detection on first read") began writing detected external edits to the changelog a
fix(changelog): stop media mtime bumps from recording bogus external edits
Commit 01e8d739c ("persist external-edit detection on first read") began writing detected external edits to the changelog and snapshotting the new content to the attic via saveExternalAttic(). That is correct for pages, which archive every revision, but wrong for media: a media file's current revision is never archived (media only copies content to the attic on replace or delete, to save space).
So getCurrentRevisionInfo()'s external-change detection had no attic copy of the current revision to work with: the unchanged-content guard always failed and the old-size lookup returned 0. A mere mtime bump (touch, rsync --times, unzip) of an unchanged media file was therefore recorded as an external edit sized as the whole file, and since detection is now persisted, that bogus entry (plus a redundant attic copy) became permanent.
The "before" size of an external change is now taken through a lastRevisionSize() seam: the base reads it from the last revision's attic copy (unchanged for pages), and MediaChangeLog reconstructs it from the previous revision's archived size plus the size change logged for the last revision. currentContentMatchesRevision() compares the current file size against that reconstructed size, so an unchanged size is treated as a mere touch (mtime reset, no entry) and a changed size is a real external edit with the correct size change.
Media no longer snapshots an external edit to the attic at all, consistent with not archiving the current revision: it will be archived if and when the file is later replaced. The mtime repair for an unreliable external date moved to a base repairExternalMtime() shared by pages and media.
show more ...
|
| eab6268c | 07-Jun-2026 |
Andreas Gohr <andi@splitbrain.org> |
fix(changelog): keep out-of-order external edits out of recent changes (#4634)
A detected external edit is recorded both in the page's own changelog and in the global recent-changes feed. When its d
fix(changelog): keep out-of-order external edits out of recent changes (#4634)
A detected external edit is recorded both in the page's own changelog and in the global recent-changes feed. When its date is older than the most recent change already in the global changelog — an old file surfacing after the feed has moved on — appending it placed it at the top of recent changes with an old date, above genuinely newer entries.
writeLogEntry() now delegates the global-feed append to writeGlobalLogEntry(), which skips an external edit whose date predates the global changelog's last-modified time. The entry still lands in the page's own changelog; it is only kept out of the cross-page feed. Normal edits are always appended.
show more ...
|
| 0a245329 | 07-Jun-2026 |
Andreas Gohr <andi@splitbrain.org> |
fix(changelog): don't record an external edit when the content is unchanged (#4634)
A current revision's file mtime can change without its content changing — a backup restore, a git checkout, an in-
fix(changelog): don't record an external edit when the content is unchanged (#4634)
A current revision's file mtime can change without its content changing — a backup restore, a git checkout, an in-place rewrite. Such a bump was detected as an external edit and logged with a 0-byte size change, cluttering history.
getCurrentRevisionInfo() now compares the current content against the last recorded revision before treating an mtime change as an external edit. When the content is identical no external edit happened: the file mtime is reset to the recorded revision date and the last revision is returned. The comparison is an abstract currentContentMatchesRevision() — pages compare the decompressed text, media compare file size then md5_file().
show more ...
|