diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 420c1d31..751fcfb8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -397,3 +397,61 @@ commits follow Conventional Commits (release notes are generated from them by `T is dropped. - Setup: uninstalling removed the client's and the Uploader's sign-in entries but left the on/off state Task Manager keeps for them. It now goes with the entry; an entry an upgrade moves keeps it. +- Server: when a desktop sharing the archive imported photos into an existing sequence, they got no thumbnails or + proxies, and the frames they renumbered answered 404, until a pass was forced by hand. A scan now notices when the + sidecar's frames changed behind the index and queues the analysis and both image passes. Analyses, image passes, + verify, maintenance, rating and tag edits and renames no longer hide such a change, or a new title set on another + PC, from the next scan. +- Server and desktop sharing an archive: each poll of the desktop after the server's uploads made the server analyse + that sequence and draw its thumbnails and proxies again. +- Archive: a rating, tag or title edit, a mass rename, a decode tier recorded by an analysis, image pass or render, or + a verify stamp wrote the whole sequence row back from what had been read earlier. Settings saved meanwhile (Auto + values, a server PATCH) were lost, or the frame count went back. These writers now write only their own fields, + under the sequence's lease. +- Server: a thumbnail or proxy pass that read the frames before a scan found photos added to the folder marked the + sequence complete again, so no pass was queued for the new photos. A pass now marks it only while the sidecar still + lists the photos it read, or while the next pass is already queued. +- Server: when a camera uploaded faster than a pass could finish, the sequence offered no thumbnails or proxies until + uploads paused. +- Server: after a verify gave photos their first hash, their thumbnails answered 404 and the next pass drew them all + again. They are served and reused again. +- Deep analysis: when the proxies of frames a run had found unreadable arrived during that run, it still recorded the + deep status, its warnings and its advice, which every later reader discards. It now checks its report against the + frames as they are when it records. +- Rebuild: a sequence that got its first photo, or was created by an upload session, while a rebuild ran lost its + index row. The Uploader got 404 and the session continued in a second sequence. A row is now checked again under its + lease before it is removed. +- Editor: an edit made while earlier photos were being added to an open sequence of this PC (a sync download, an + import, a scan) was saved in the old frame order, so other photos were excluded and the hero and keyframes moved. + The editor now reads the frames again before it saves and moves its positions with them, undo steps included. +- Editor: a render queued after earlier photos were added to an open sequence, without another edit, rendered the old + frame order. Render now reads the frames again first. On a server sequence whose frames changed it is not queued, + and the editor goes read-only with Get proxies. +- Editor: when earlier photos were added to an open sequence, the frame on screen became another photo, and Exclude, + Set hero and keyframes applied to it. The frame on screen now stays on its photo. +- Editor (server sequences): a save made after the server's frames changed, before the editor heard of it (scans send + no event; events are lost while reconnecting), overwrote the positions the server had moved. Saves now name their + frames version, so the server refuses them and the editor goes read-only with Get proxies. Frames are compared again + after a reconnect. +- Sync: when a server folder held the same photo twice, settings crossing to this PC put every exclusion, hero and + keyframe of that photo on its first copy, and a later push changed the server's. Each copy now keeps its own + positions, and a photo not hashed yet is never taken for another of the same size and capture time. +- Sync: with Keep proxies offline, thumbnails cached in place of proxies were never replaced when a server sequence + could not get all its proxies (a missing or damaged frame). They are now downloaded again once the server offers + their proxies, and again after a failed download. +- Server: a proxy upload above 1 MiB that the server answered without reading it closed the connection, and clients + retried a network error. This happened when the session was signed out, the Edit role was lost, the frame was gone + or the proxy was not wanted. The answer now reaches the client. +- Settings › Archive: a template, proxy size or thumbnail size committed while the archive's settings were being read + could be shown reverted, together with this PC's default, while the archive kept the edit. This happened on a share + that was waking up. Such a read now waits for the edit and is made again, so choosing another archive folder also + finishes only once the rows show that folder's archive. +- Import: a server import that could not stage its copies on this PC said the destination was full or refused writing. + It now names this PC's cache folder. +- Import: a failed archive import showed the job's raw system or database text as its line. It now shows the archive's + own sentence or 'The import stopped before the end.', with the text in the tooltip. +- Portable copy: a SharePoint or Teams library synced with OneDrive's Sync button was not recognised as synchronised, + so a portable copy unpacked there kept its index inside it. Its data now goes to %LOCALAPPDATA%\Titano. +- Docs: the Windows README's recovery of a data folder created by an unelevated console run keeps the folder private. + It no longer resets the permissions, which let every user read the TLS key and the temporary admin password, and it + removes the account the service names, also when a standard user ran the console. diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index 38b11209..de2c3bca 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -362,3 +362,21 @@ One line per decision: date · decision · alternative · reason. | 2026-10-12 | Deployment guidance (compose comments, releases README, Unraid template) lists the reverse proxy container's own fixed address in `TITANO_TRUSTED_PROXIES`: a fixed IP on a user-defined network shared with Titano, reached on that network rather than through a published port. It warns never to list a subnet, the network gateway or Docker's default bridge. For a proxy on the Docker host itself, Titano runs with `network_mode: host` and the proxy reaches it over loopback. This replaces 'its address or subnet' in the trusted-proxies row above. | Keep recommending the shared network's subnet; make the server refuse gateway addresses | Docker's userland proxy relays IPv6 clients and the host's own connections to published ports from the gateway. On Unraid's default bridge the subnet also covers every other container. Trusting a subnet would let any of them set X-Forwarded-For/Proto again. The server cannot tell a gateway from a proxy, so the guidance has to carry the rule. | | 2026-10-12 | Sign-in entry move: on an upgrade, setup moves the client's or the Uploader's sign-in entry that starts a program the upgrade removes. The entry then starts the program of the same component in the new payload (its shortcut target), with the same options and value name. The entry is removed only when that component is no longer installed. Uninstall removes the entries of the programs its log lists, as before. | Delete the entry and let the client follow it (impossible: nothing is left to follow); remove the client's follow and drop rename support | Setup runs while the programs are closed and knows both the removed and the new program. So the rename case of the Startup row ('rewritten only when an update renamed the program') survives the upgrade, and Task Manager's on/off state stays with the unchanged value name. The client's own follow remains for an entry setup did not move. | | 2026-10-12 | Setup removes a sign-in entry's Task Manager state (`StartupApproved\Run` value of the same name) together with the entry; an entry an upgrade moves to a renamed program keeps it. | Leave the value (Windows ignores it without a Run value) | Uninstall leaves nothing of the entry behind, and an entry the user turned off stays off after an upgrade that renames its program. | +| 2026-10-12 | A scan reads a sidecar again under the sequence lease when it lists other frames than the index row, then moves the project's positions and indexes it. This happens when another process (a desktop sharing the archive, through its ArchiveIngest) added, removed or renumbered frames together with their sidecar entries. On a server (`ArchiveServiceOptions.ImagesAfterScan`) the scan clears AnalyzedLight, ThumbsBuilt and ProxiesBuilt in its own row only, so its follow-ups queue the light analysis and both image passes, whose marks set the flags in both places again. The shared sidecar keeps the writer's flags, and a desktop clears nothing. Photos the scan reconciles itself still clear the three flags in the sidecar. | Clear the flags in the sidecar on every host; clear them in ArchiveIngest at every insert; clear them in the row on every host | Row 'A server's scan queues…' covered only photos copied in by hand, which Reconcile finds. The frames another Titano writer listed answered 404 on /thumb and /proxy until a pass was forced by hand. Cleared in the shared sidecar, a desktop's poll after every server upload cleared flags the server's post-upload passes had just set, and the server then repeated the analysis and both passes. Cleared in a desktop's row, its Library would show no proxies until the sidecar next changed, and the light analysis would run again with the desktop's codecs. Clearing at every insert was rejected before (row 'The server's manifests…'). | +| 2026-10-12 | Writers that change part of a sequence write the sidecar and the index under one sequence lease. The index is written from the sidecar read under that lease, and only in the columns the writer owns. These are decode tiers (`SequenceRepository.RecordTiersAsync`), image-pass flags (`UpdateStatusAsync`), the verify (`RecordVerifiedAsync`) and integrity and duplicate flags. Title, tags, rating and notes go through `EditAsync` at the settings version read under the lease; the edit is applied again on a conflict, and the sidecar is then written from the stored row. A mass rename uses `RelocateAsync`: the folder, and the title only for a step that retitles. | Read the row FOR UPDATE and upsert the whole row from the sidecar | A whole row written from a sidecar this index had not synced claimed another process's frame count and frames version while the frames table lagged. It also wrote back settings committed after the row was read: an analysis's Auto values, or a server PATCH, which takes no lease. Column writes cannot undo either. | +| 2026-10-12 | Such a writer records the folder's scan stamps after its write only when, before that write, the index held the folder as it was (`ArchiveIndexer.InStepAsync`). That means the stamps stored for the folder are still the sidecar's and the photo folder's, and the row holds the sidecar's frames version. Otherwise the folder stays changed for the next incremental scan, which writes the whole row from the sidecar. A folder that a nested sequence moved out of during a mass rename is therefore read again by the next scan. | Compare only the frames versions; record the stamps unconditionally | Partial writers no longer carry the whole sidecar into the index. A desktop's retitle, rating, import or verify therefore reaches the server's index only through a scan, and stamps recorded by a later partial write hid it until the folder changed again. The stored stamps tell whether anything other than this index's own writes touched the folder. The frames version also catches a sidecar rewritten at the same size within the file system's time resolution. `SyncService.ApplyLocallyAsync` (sync workstream) still records stamps unconditionally after its metadata write. | +| 2026-10-12 | An image pass sets ThumbsBuilt or ProxiesBuilt in two cases, and otherwise clears it. First, when it covered every frame it read and the sidecar under the lease still lists those photos: same id, index, file, size and capture time, and the same hash unless the pass read none. Second, when a pass of the same kind is already queued for the sequence. | Clear whenever the frames differ; compare only the frames version | Thumbnails and proxies are kept by frame index. A pass that read the frames before a scan's reconcile must not set the flag the scan cleared, or no pass is queued for the new photos. During an upload burst every pass is overtaken, and clearing then left a server unable to offer any thumbnail or proxy of the sequence until uploads paused. The queued pass draws the new frames, as between an upload and its pass (row 'The server's manifests…'). | +| 2026-10-12 | A thumbnail drawn before a verify hashed its photo still counts as that photo's (`ThumbPack.IsFrom`): image passes reuse it and the server serves it. Such a thumbnail carries the fingerprint of the file name and size. One drawn from another hash, file or size does not count. | Clear ThumbsBuilt when a verify hashes frames, and draw them again; serve only exact fingerprints | Hashing changes nothing about the photo. After a verify, the thumbnail of every scan-adopted frame answered 404 while ThumbsBuilt stayed set and no pass was queued, and the next pass drew them all again. | +| 2026-10-12 | A deep analysis checks its own report against the frames as they are when it records. It reloads them under the sequence lock and applies `SequenceAnalyser.ReadReport`'s rule. If the run found a frame unreadable and that frame's proxy arrived during the run, the report counts as none for the Auto values, AnalyzedDeep, HasWarnings, the warning count and the stored summary. The advice is applied under the same lock as the status. Refines 2026-10-12 '`analysis.json` lists the frames…'. | Queue another light analysis when the report is stale; keep the deep status until the next light analysis | The light analysis that an arriving proxy queues can finish on another worker (Auto is cores/2) before the deep run records, and nothing runs it again. The stale deep status, warning count and Library badge then stayed, while the report endpoint answered 404. Under one lock, that light analysis either ran before and is not undone, or runs after. | +| 2026-10-12 | Before deleting a row that the folders listed at its start do not back, a rebuild checks it again under the row's sequence lease. The row stays when it waits for its first frame, when its current folder holds a sidecar naming it, when that sidecar cannot be read, or when another process holds its lease. | List the folders again at the end; keep rows whose updated_at is later than the rebuild's start | Uploads go on during a rebuild, which can take minutes. A first frame's new folder, or a new session's sequence, is not in the listing taken at the start. Dropping its row gave the Uploader 404, and (with the session mapping cascaded away) split the session into a ' (2)' sequence. A second listing still races, and updated_at moves for many unrelated edits. | +| 2026-10-12 | A local editor's save is refused under the sequence lease (`FramesChangedException`, nothing written) when the sequence's frames version has moved since the editor read its frames. The index edit also names that version. The editor then reads the sequence again and moves its project, its basis and every undo and redo step the way the index moved the stored copy (`ProjectSettings.FollowFrames`): by frame id when every frame it read is still there, otherwise unchanged; waiting photos are placed. It then saves the project in the new order, up to 3 times. The editor reads the row and frames as one state: the frames are listed between two reads of the row at the same frames version, 3 attempts, then 'Photos are being added to this sequence; wait a moment and try again.' Reads of the sequence never overlap: each waits for the one under way, and saves wait for it, so each read follows the frames the one before took. The frame on screen stays on its photo. | Translate inside the source and keep the editor's old frame list; refuse with an error and reload, losing the edit; store positions by frame id | Insertions hold the same lease, so the check is exact. Applying the index's own rule moves basis, edit and stored copy alike, so the three-way merge stays meaningful. Undo steps must move too, or Ctrl+Z brings back positions in the old order. Two jobs that end together read the sequence at once, and the later frames must not be followed back to the earlier ones. Positions stay positions (row 'Project frame positions…'). | +| 2026-10-12 | Before a render, the editor checks that the frames it read are still the sequence's (`ISequenceSource.FramesCurrentAsync`: the index row's frames version on this PC, the manifest on a server). On this PC it reads the sequence again first, so the project the job embeds names the moved positions. A server sequence whose frames changed turns outdated (read-only, Get proxies) and the render is not queued. A render already waiting in the queue keeps the project it embedded. | Carry the frames version in `RenderJobParameters` and fail the job in the local, managed and render-node handlers; check inside `SubmitAsync` | The editor learns of an insertion only at its next save or after its own job, while Render embeds the project at once. One row read (one manifest read on a server) per render keeps the check in the editor, and the job format, the render handlers and the render nodes stay as they are. A render left waiting in the queue while earlier photos arrive is the one window left; closing it needs the job format to change. | +| 2026-10-12 | The desktop editor of a server sequence sends `expectedFramesVersion` in its PATCH: the frames version of the proxies it holds. On any 409 it reads the manifest. Other frames make it outdated (read-only, Get proxies; the edit stays pending). The same frames at a new frames version retry at that version. After a lost event socket, and before a render, it compares the frames again. Servers that predate the field ignore it. | Read the new frames and translate the edit (needs the new frames' proxies); show `Server.Error.FramesConflict` and drop the edit | Server scans publish no sequenceChanged event, and events missed during a reconnect were never checked, so a save or a render could use positions the server had moved. The outdated state (row 'Server sequences whose cached frames…') already says why and offers the fix in the editor's own sentence. | +| 2026-10-12 | Positions crossing copies by photo tell copies of one photo apart by their order (`FramePhotos.Occurrence`). A position on the n-th frame holding a photo goes to the n-th frame holding it on the other copy. When that copy holds fewer, it waits as a pending frame with `occurrence` n; occurrence 0 is not written. A hashed photo is the frames holding its hash; size and capture time count only when no frame holds the hash. | Map to every matching frame; keep the first copy; keep the receiving copy's own positions for duplicates; count unhashed frames of the same size and time as copies of a hashed photo | A PC keeps one copy where an adopted server folder holds two ('IMG_0001.JPG', 'IMG_0001 (1).JPG'). The server's exclusion of the duplicate, which the deep analysis flags, must not exclude the PC's only copy, and a push must give the server back exactly what it had. Keyframes then never pile on one frame, and older projects read the same. A frame not hashed yet may be another photo of the same size taken in the same second (an uncompressed RAW in a burst): parking a position until hashing is safe, while moving it to that photo is not. | +| 2026-10-12 | With Keep proxies offline, a stale proxy cache of a server sequence without `ProxiesBuilt` is compared with the manifest's per-frame `HasProxy`. This happens once per change of the server's update time. A frame offered as a proxy that the cache holds only a thumbnail for (or a file of unknown kind, or nothing) queues the background proxy download. A comparison that queued a download counts only once that download is done: a failed or cancelled one is compared again after its backoff. This refines the proxy-cache kinds row. | Wait for `ProxiesBuilt`; read the manifest at every refresh; offer a manual re-download on ProxiesOnly rows | `ProxiesBuilt` waits for every frame, and a missing or damaged frame never gets a proxy, so the flag never came. A proxy that arrives leaves a new update time through the proxy pass it queues. One manifest read per change is enough, and a download that cannot improve the cache is not queued again. The server's sequence may never change after a failed download, so the failure itself must reopen the comparison. | +| 2026-10-12 | `PUT /api/v1/frames/{id}/proxy` carries its 64 MiB request body limit (`ArchiveImages.MaxProxyBytes`) as endpoint metadata, as the chunk route does; the handler no longer raises it. | Raise the limit in the handler after the frame checks (as before) | Authentication's 401 and 403 and the handler's 404 and 422 answered with the proxy unread. For a proxy above 1 MiB, Kestrel then closed the connection, and clients retried a network error instead of stopping on 401/403 or skipping the frame on 404/422. | +| 2026-10-12 | Settings › Archive never shows a read of the open archive's settings (index row and archive.json) that overlapped an Archive row edit being written (`ArchiveReadGate`). The read waits until no edit is being written and is made again, so a folder change or the reload when Settings is shown is done only once the rows show the archive's values. A read waits for every edit being written, whichever archive the edit is for. | Serialise reads and edits behind one lock; take the settings lease for reads; drop the overlapped read and leave the reload to the edit's end; key the gate by archive | A lease-free read on a share that is waking up can return archive.json from before the edit. Showing it would put the old value back on the row and in this PC's defaults while the archive keeps the edit. A lock would still apply a read begun before the edit over the value the user had just committed. Leaving the reload to the edit's end let a folder change finish while the rows still showed the archive before it. Waiting for edits to other archives costs at most one edit's write, and keeps the rule simple. | +| 2026-10-12 | A sink whose staging folder is on this PC (`IImportSink.StagesOnThisPc`: the server import, which stages in the cache folder) names that folder when staging fails. A full disk reads 'The drive of this PC's cache folder is full.' (beside each photo and as the stop cause), and a refused write reads 'Titano may not write to this PC's cache folder.' | Keep 'The destination is full.' and 'Titano may not write to the destination.'; check this PC's free space in the server plan | The server answers for its own space and rights with its own sentences, so in a server import these failures always concern this PC. The plan's space check is the quota, and staging holds one batch at a time. | +| 2026-10-12 | A failed archive import job shows on the Import screen the archive engine's own sentence when the job's error is one: offline, read-only, busy, newer format, card gone, or a photo it could not add. These are matched against the catalog in the language shown. Any other error shows 'The import stopped before the end.', and the job's text stays in the tooltip and the logs. | Show `job.Error`; map exceptions to sentences in the import job handler | The job engine keeps only the exception's message, which for SQLite, file moves and the framework is technical English. BRIEF §0.2 rules 5–6 and the 2026-10-12 per-photo row keep such text off a translated screen. A job that failed before a language switch reads as the catalog's sentence. | +| 2026-10-12 | (Partly supersedes the README part of the service start-up row above.) The Windows README fixes a data folder created by an unelevated console run from a Command Prompt run as administrator: `takeown /A /R`, then `icacls /remove:g "PC\name" /T`. PC\name is the account the service's refusal names (`dir /q C:\ProgramData` shows it as the folder's owner until takeown); `%USERDOMAIN%\%USERNAME%` is that account only when the prompt runs as whoever ran the console. Ownership goes to Administrators, and that account's entries come off the folder, the TLS key and the password file. No other account gains access at any step. | `icacls /reset /T`; `/remove:g "%USERDOMAIN%\%USERNAME%"` from the prompt's account; delete the secrets and let the server make new ones; have the server re-apply its DACL to every protected child | A reset makes everything inherit %ProgramData%'s ACL: every local user could read titano.db, the TLS private key and the temporary admin password, and could plant files that stop the next start. A standard user may create the folder (Users may create folders in C:\ProgramData), and the administrator who repairs it then runs the prompt as another account, so the prompt's own name would remove nothing and leave the key and password readable by that user. Deleting initial-admin-password.txt loses the only copy of the temporary password of an administrator the console run already created. | +| 2026-10-12 | (Partly supersedes the portable OneDrive row above.) Sync roots also come from `HKCU\Software\SyncEngines\Providers\OneDrive\*\MountPoint`, where OneDrive registers each folder it syncs, including SharePoint and Teams libraries synced with their Sync button. | Read `Accounts\*\Tenants` or `ScopeIdToMountPointPathCache` | Such libraries lie beside the account's UserFolder (`%USERPROFILE%\\ - `), not in it. The SyncEngines key is the documented location Office itself reads to find synced files (Microsoft Learn, cloud storage partner program); the other values are undocumented. | diff --git a/docs/STATUS.md b/docs/STATUS.md index 2aa1474f..e58ed684 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -20,7 +20,9 @@ Phase plan: docs/BRIEF.md §22. Windows behaviour is verified on CI (`windows-la A full audit against the brief, `CLAUDE.md`, the UI kit, the tests and the Docker and client setups confirmed 71 defects with independent verifiers. A second pass over the fixes confirmed 37 more (proxies and decode tiers, project positions crossing copies through sync, server scans and maintenance, desktop settings and polling, a portable copy -inside OneDrive, setup and deployment guidance). All are fixed, each with tests (rows dated 2026-10-12 in DECISIONS and +inside OneDrive, setup and deployment guidance), and a third pass 16 more (editors open while photos arrive, partial +writers of the index row, image passes after another writer's import, smaller error-text and documentation gaps). All +are fixed, each with tests (rows dated 2026-10-12 in DECISIONS and CHANGELOG), except that the screenshot diff (BRIEF §20.2 visual regression) gates nothing until its first baselines are committed (Next steps). The Docker image was built and run with PostgreSQL 17, a fresh archive folder and remapped ports; the client installers are installed, run, upgraded and removed on `windows-latest` by the