• exec/load/mailbox_summary

    From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Fri Nov 20 17:46:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/7845d4b8bc6d38e908f9d307
    Modified Files:
    exec/load/mailbox_summary.js
    Log Message:
    Mailbox library: date the private base's files after a write (#1374)

    After a change to a user's private mail base, the summary cache stores
    the date and size of the base's .shd and .sid files, taken while the
    base is still open. On a network file system (SMB, NFS) a write may
    show in a file's date only once the file is closed, so the stored date
    was the old one: the next request saw a "change" and read every header
    again.

    Summary.modify() now sets the date of both files to now (file_utime())
    after the write and before taking those stamps. Measured on a Samba
    share with a 12-message base: the get() after the library's own header
    change read 12 headers before and reads none now; on a local disk it
    read none either way.

    Only the private base is dated this way. Nothing but this library
    writes to it, which matters because on an SMB share a file whose date
    has been set stops being dated by later writes while it is open. The
    system mail base is left alone; doing the same in smblib for every
    writer is discussed in #1374.

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
  • From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Fri Nov 20 18:20:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/e1a997ca9d009389416e39f5
    Modified Files:
    exec/load/mailbox_summary.js exec/tests/mailbox/summary.js
    Log Message:
    Mailbox library: a modify that changed nothing leaves the files' dates alone

    7845d4b8bc (audit-3-foul, 2026-11-20) set the date of the private
    base's files after every Summary.modify(). When the function it runs
    reported no change and made none, the new date itself read as a change
    once the clock had moved to the next second, and the cache was rebuilt: "no-change modify reads nothing: expected 0 got 50" in summary.js on
    the slow freebsd-amd64 valgrind job.

    The dates are now set only when the function reported what it wrote, or
    when the files' date or size show a write. The test waits for the next
    second before its no-change modify, so it fails with the earlier code
    on any machine.

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
  • From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Fri Nov 20 22:41:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/f3289a5bbdc590c6d2bcc950
    Modified Files:
    exec/load/mailbox_summary.js exec/tests/mailbox/summary.js
    Log Message:
    Mailbox library: keep the summary when a file's date steps back at close

    After its own write, Summary.modify() sets the date of the private
    base's files and records it (#1374). On an SMB share the server can,
    when the base is closed, put a file's date back to the time of the
    write itself. When the write and the date set fell in different
    seconds, the file ended up dated one second before the recorded stamp,
    and the next request read every header again. Measured on a Samba
    share with a 20-message folder: the list after starring a message or
    renaming the folder read 20 headers whenever that happened.

    The recorded stamps now count as current when the sizes match and a
    file's date is the same or up to 2 seconds earlier. A later write moves
    a date forward, never back, so an earlier date does not hide one. The
    dates are also set right after the write, before the changed headers
    are read, to keep the two times close.

    With this, the same measurement reads no headers after a star, a
    read mark, a delete or a folder rename, also when the date stepped
    back.

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>