fix(sync,upload): keep tombstones honest and let an explicit upload bring a photo back

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)
This commit is contained in:
Alby96 committed 2026-10-27 12:45:33 +01:00
1 parent eb607d47aa
commit 316c182b19
18 files changed
+753 -63

No files matched your search

+4 -2
View File
@@ -778,6 +778,8 @@
<data name="Admin.Trash.Title" xml:space="preserve"><value>Cestino</value></data>
<data name="Admin.Upload.Add" xml:space="preserve"><value>Aggiungi foto</value></data>
<data name="Admin.Upload.Add.Tip" xml:space="preserve"><value>Scegli le foto su questo computer; puoi anche trascinarle in questa finestra</value></data>
<data name="Admin.Upload.Again" xml:space="preserve"><value>Carica di nuovo {0}</value></data>
<data name="Admin.Upload.Again.Tip" xml:space="preserve"><value>Carica di nuovo: aggiungi questa foto alla sequenza anche se ne era stata eliminata; Carica la invia</value></data>
<data name="Admin.Upload.Bytes" xml:space="preserve"><value>{0} di {1}</value></data>
<data name="Admin.Upload.Cancel" xml:space="preserve"><value>Annulla</value></data>
<data name="Admin.Upload.Cancel.Tip" xml:space="preserve"><value>Ferma ora: le foto non ancora finite vengono scartate sul server</value></data>
@@ -809,14 +811,14 @@
<data name="Admin.Upload.Skipped.Folders" xml:space="preserve"><value>Cartelle saltate: {0}</value></data>
<data name="Admin.Upload.Skipped.Folders.Tip" xml:space="preserve"><value>Le cartelle si importano con l'app desktop; qui si caricano solo foto</value></data>
<data name="Admin.Upload.Skipped.Formats" xml:space="preserve"><value>Non foto: {0}</value></data>
<data name="Admin.Upload.Skipped.Formats.Tip" xml:space="preserve"><value>Esclusi i file in un formato che il server non legge come foto</value></data>
<data name="Admin.Upload.Skipped.Formats.Tip" xml:space="preserve"><value>Esclusi i file nascosti e quelli in un formato che il server non legge come foto</value></data>
<data name="Admin.Upload.Skipped.Size" xml:space="preserve"><value>Troppo grandi: {0}</value></data>
<data name="Admin.Upload.Skipped.Size.Tip" xml:space="preserve"><value>Esclusi i file oltre il limite di caricamento del server ({0})</value></data>
<data name="Admin.Upload.Start" xml:space="preserve"><value>Carica</value></data>
<data name="Admin.Upload.Start.Tip" xml:space="preserve"><value>Invia le foto non ancora sul server; il server controlla ognuna con il suo SHA-256</value></data>
<data name="Admin.Upload.State.Cancelled" xml:space="preserve"><value>Annullata</value></data>
<data name="Admin.Upload.State.Deleted" xml:space="preserve"><value>Eliminata prima</value></data>
<data name="Admin.Upload.State.Deleted.Tip" xml:space="preserve"><value>Eliminata in precedenza da questa sequenza: ripristinala dal cestino per riaverla</value></data>
<data name="Admin.Upload.State.Deleted.Tip" xml:space="preserve"><value>Eliminata in precedenza da questa sequenza: ripristinala dal cestino finché c'è, o caricala di nuovo</value></data>
<data name="Admin.Upload.State.Done" xml:space="preserve"><value>Caricata</value></data>
<data name="Admin.Upload.State.Done.Tip" xml:space="preserve"><value>Sul server e verificata con il suo SHA-256</value></data>
<data name="Admin.Upload.State.Exists" xml:space="preserve"><value>Già presente</value></data>
+1
View File
@@ -71,6 +71,7 @@
<data name="Server.Error.NotFound" xml:space="preserve"><value>Non trovato.</value></data>
<data name="Server.Error.NotChronos" xml:space="preserve"><value>Questo indirizzo non è un Chronos Server.</value></data>
<data name="Server.Error.PasswordChangeRequired" xml:space="preserve"><value>Cambia prima la password.</value></data>
<data name="Server.Error.PhotoRemoved" xml:space="preserve"><value>La foto è stata eliminata dalla sequenza mentre veniva caricata, quindi non è stata aggiunta.</value><comment>long</comment></data>
<data name="Server.Error.ProxyUntrusted" xml:space="preserve"><value>Questa pagina non è arrivata da un proxy attendibile in HTTPS. Aprila tramite il proxy o aggiungi l'indirizzo del proxy a CHRONOS_TRUSTED_PROXIES.</value></data>
<data name="Server.Error.ProxiesDisabled" xml:space="preserve"><value>Questo archivio non crea proxy.</value></data>
<data name="Server.Error.ProxyMismatch" xml:space="preserve"><value>Il proxy è stato creato da un'altra foto.</value></data>