The upload dialog's completion helper called `api`, which only exists inside
openUpload, so every web upload failed with a ReferenceError at its last step.
complete() now takes the dialog's api. A new test lexes every admin module and
fails when a top-level function uses api without taking it; it flags the old
upload.js.
During a run Esc is now stopped on the document in the capture phase. The old
listener sat on the dialog, so with the focus on the body (Start disables
itself, a click on the dialog's text) a second Esc closed the dialog and threw
the uploads away. The listener is added when a run starts and removed when it
ends or the dialog closes.
A sequence page refreshes after any ended job, because jobState names no
sequence. That refresh now redraws the header only when the sequence changed,
and the renders only when their list did. Stars, tags and renders are redrawn
through redraw(), so the keyboard focus stays put. restoreFocus finds an
unnamed control by its place, not as the first unnamed one. Failed thumbnails
are retried with a doubling wait and at most 8 tries, counted again once the
sequence changes.
The trash page reads the emptying it follows from /api/v1/jobs/{id} on every
load and after the event socket reconnects (api.events now emits
"reconnected"), so Empty no longer stays disabled when the job's end was lost.
A Restore in flight stays disabled across redraws.
The Library list counts cancelled jobs as ended (shared JOB_ENDED). Comments
are corrected in shared.js and library.js.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 641b9cd96b95d523990d1414c2bdead4138c5f4d)
Sync:
- A server frame that has not been hashed is known by content only once it is
downloaded: one this PC deleted (or holds as its replacement) is now deleted
from staging instead of filed again, which also dropped its tombstone.
- An unhashed local original that turns out to be a photo the server deleted
is not uploaded, and the archive verify then writes the hashes into the
index, so the row settles instead of offering Upload for good.
- A tombstone leaves a photo out of the comparison only when its side no longer
holds that content, so a tombstone left beside a held copy does not keep the
other side's copy missing forever.
Uploads:
- StartUploadRequest.Restore (optional, never sent by sync or older clients)
lets an explicit user upload file a photo deleted from the sequence again,
also after the trash was emptied; the completion repeats it with
?restore=true and the ingest drops the tombstone.
- The completion checks the tombstone again: a photo deleted while its bytes
were on the way is not filed (409 photo_removed, upload cancelled); the
protocol client reports that as not sent.
- A tombstone of content a frame of the target still holds refuses no repair.
- Hidden dot names (AppleDouble "._" files) are refused, as the archive
scanner leaves them out.
Web upload dialog:
- Upload again on rows marked Deleted before; the tooltip no longer promises
a trash restore that may be impossible.
- Sends a capture time: the Exif DateTimeOriginal of a JPEG or TIFF-based file
(minimal in-house reader, capture-time.js), else the file's time, so photos
without Exif keep their order.
- Esc is stopped at keydown during a run (Chromium allows one prevented cancel
per activation); hidden dot files are left out; a completion refused while
another one files the upload waits for it; the same photo picked under two
names waits for its first copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d051bcfc351f5a08500ca864a6508576a95492a4)
Owner review 2, R3: the panel can add photos to an existing or a new
sequence without the desktop app. upload.js is a dialog the library pages
open (openUpload({ api, sequence, onDone })): file picker or drag and drop
(folders are counted and left out: whole-folder import stays on the
desktop), per-photo state, a total bar, Cancel that deletes the started
uploads, and a leave-page guard while sending. Each photo is hashed in a
same-origin module worker with an in-house incremental SHA-256 (8 MiB
reads; crypto.subtle cannot hash in pieces), which runs the FIPS 180-4
known answers and a crypto.subtle cross-check before its first hash and
refuses to hash on any mismatch; the server verifies the hash again.
Chunks go through api.putBytes with the session's CSRF header, two files
and two chunks at a time, retrying no answer, 429 and 503; quota, space
and permission refusals stop the run with the server's message, and a
photo deleted from the sequence shows as deleted before.
server/info now lists the photo extensions the archive files, so the
dialog offers and sends only those. The CSP already allows the worker
(worker-src falls back to script-src 'self'); tests pin that, the module
walk follows the worker, and a browser-shaped upload runs end to end
through the cookie session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit c64c60ab8bb41c102182e284177ac04a56bf1058)