Repository navigation
feat(worker): Update the row in place when a file's content changes at its path (#250) - #287
Merged
Merged
Conversation
#283) NewContentWriter now adds the primary's proxies with AddProxyFile, as PairedMovProxyWriter does for the MOV, instead of through the ProxyFiles navigation. Both pick an owner's proxies with IngestionContext.ProxyFilesOf. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t its path (#250) A file whose bytes change at a stored path is classified ContentChanged and processed like new content; ContentChangedWriter then updates that row instead of inserting one beside it, so it no longer fails on every crawl. The row keeps its Id, interactions, BurstId and PairedAssetId; its hash, capture date, media type, Metadata and proxy rows (updated by type) are new. IngestionContext separates AttemptId, which names temporary files and scopes compensation, from AssetId, the owner of the proxies, which classification sets to the stored row for ContentChanged. A failed attempt therefore deletes only its own proxies, never the row's previous ones. The old content directory is left to the orphan sweeper (#174). An edited Live Photo MOV is #285. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ers (#250) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #250. Builds on #283, which landed separately as #288.
What changes
A file whose bytes change at a stored path (re-exported, rotated, metadata stripped) used to fail ingestion on every crawl. Its new hash was unknown, so it was inserted at a path the old row already held, which violated
IX_MediaAssets_StorageConfigId_FilePath. Now the file is classifiedContentChangedand updates that row in place:Id, interactions,BurstId,PairedAssetId. A Live Photo whose HEIC was edited stays paired to its MOV.ContentHash, capture date (DateCaptured,Month,Day,Year),MediaType,LastSeenOnNas, everyMetadatafield, and the proxy rows.ix_proxyfiles_assetid_proxytype. Missing types are added and types no longer generated are removed.How
ContentChangedbranch: no row has the hash, but an active row holds the path. A soft-deleted row at the path stays out of scope (Soft-delete assets whose file a complete crawl did not find #34).ContentChangedWriter. It sharesProcessedContentWriterwithNewContentWriterfor the MOV block, the EXIF-to-Metadatamapping and the save. Capture date and proxy rows use refactor(worker): Capture date in one place, proxy rows added one way (#283) #288's single paths (DateCapturedsetter,AddProxyFiles).LoadMetadataAsyncandRemoveProxyFile.IngestionContext.AttemptIdis now separate fromAssetId.AttemptIdnames temporary files and scopes compensation.AssetIdis the row that owns the proxies, set by classification: the stored row forContentChanged, the attempt id forNew.ContentChangedwherever it lists the outcomes and writers, and documents the feat(worker): Orphaned proxy file sweeper (proxies ↔ DB reconciliation) #174 decision.Deliberately not here
ContentChangedon its own half, but the MOV row is not updated yet. It no longer fails either. Tracked in Update the MOV row when a Live Photo's video is edited at the same path #285.FileNameis not reassigned. The path is unchanged, so the name is too.Verification
dotnet test: all 1,327 tests pass.scripts/mutation-changed.sh(passedClassificationMiddleware.csandImageProxyMiddleware.csfor the two test files that map to no single source): 100.00%, with 271 killed, 1 timeout and 0 survivors, after merging refactor(worker): Capture date in one place, proxy rows added one way (#283) #288. There are no new Stryker directives, so ADR 0005 has no new rows.🤖 Generated with Claude Code