Files
bambuddy/backend
maziggy e5b8e76ea1 Recognise our own print dispatch instead of guessing at a magic number
(#2843 follow-up)

    Bambuddy records the project_file behind every print, because that command
    names where the sliced file was put and so decides whether the archive can
    have a thumbnail and slicer metadata at all. Its own dispatches were told
    apart from a slicer's by testing sequence_id against "20000", on the
    belief that 20000 was Bambuddy's alone.

    It never was. 20000 is the slicer convention Bambuddy copied --
    virtual_printer/bind_server documents the slicer sending exactly that
    during detect -- and both slicers count up from it. Measured on the wire:
    OrcaSlicer dispatched 20000 and then 20001, BambuStudio 20009 and 20010.
    So whichever dispatch happened to land on the shared value was filed as
    ours and never recorded, and after a slicer restart that is the first
    print you send. The test was wrong in the other direction too: it called
    every value above 20000 external, including ones we had sent ourselves,
    which only stayed invisible because we always send exactly 20000.

    Ownership is now established by remembering the job actually dispatched
    -- sequence id, file, url and subtask name -- and consuming that marker
    on the echo. One-shot deliberately: a slicer reprint of the same file a
    moment later is somebody else's print and must not hide behind our last
    one.

    Nothing about printing or archiving changes. current_project_url and
    ams_mapping are both captured before this branch and always were, so the
    storage verdict that gates the FTPS sweep is untouched; two tests pin
    that, because it is the part that would actually cost archives if it
    drifted. What changes is that the diagnostic entry stops lying, and it is
    the entry that tells an operator whether their printer stores files
    somewhere Bambuddy can read -- which is the whole subject of #2780 and
    would have to count, and an undercount there would have been silent.
2026-08-17 15:47:43 +02:00
..