Repository navigation
feat: add file content replacement - #155
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05a583e0af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d5403acea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| var download = await fileStorage.GetPresignedDownloadUrlAsync( | ||
| key: file.StorageKey.Value, | ||
| versionId: file.VersionId!.Value, |
There was a problem hiding this comment.
Populate active versions before requiring them for downloads
On an existing deployment, AddFileContentUpdates adds a nullable version_id column without populating it, so every previously ready file retains a null VersionId. Those files pass GetDownloadContentType() and then throw NullReferenceException here, turning previously working download-URL requests into HTTP 500 responses. Repository-wide searches found no backfill, and upload reconciliation only processes pending uploads and content updates, not ready files. Populate and pin existing objects' versions before making this dereference mandatory, or provide a safe compatibility path until they are migrated.
Useful? React with 👍 / 👎.
|
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |

0 New Issues
0 Fixed Issues
0 Accepted Issues
Adds
PUT /api/v1/files/{id}/content(multipartFile, 204) using existing Personal.own/.alland Avatar update permissions. File identity, name, type, owner, folder and S3 key stay unchanged.Persist
Updating, the active S3VersionIdand a uniqueContentUpdateAttemptIdbefore uploading. Upload to the same key withcontent-update-attempt-idmetadata, then inspect the exact version returned by S3 and save its verified ContentType, Size and VersionId. The shared metadata key comes from Core Application'sStorage.Constants.FileMetadataNames; the local constant is removed.FileContentUpdatePolicy.CanAcceptshares operation, version and stored-metadata validation between the handler and worker; request-specific ContentType and Size checks stay in the handler. Download URLs are pinned to the active version, including during Updating. Rename, move, delete and another content update conflict until the attempt completes or expires. Optimistic concurrency and the expected operation ID fence stale requests.The existing worker first inspects current content and, when necessary, enumerates versions of the exact key to find the matching operation. This recovers lost upload responses and failed final database saves even when a cancelled upload finishes later and becomes S3's latest version. After ExpirationAge, an attempt with no valid matching version is cancelled and the previous active version remains Ready. Storage inspection/list failures leave the attempt for retry. The deployment has no existing file records. Every successful initial upload stores its version before becoming Ready; updates and download URLs use that stored version directly. The nullable version column accommodates PendingUpload records. No existing-file version discovery or backfill is needed. Download URL requests with an unexpectedly missing active version return 409 explicitly without inspecting S3.
Updates Application Core to 6.3.1 and S3 Core to 1.3.1. Adds nullable active-version and operation-ID columns; removes temporary replacement keys and their cleanup scheduler. Requires bucket versioning and S3 permissions for version reads and version listing (
GetObjectVersion,ListBucketVersions). Retain the DB-active version even when it is no longer S3's latest; a blanket noncurrent-version expiration rule can remove active content. The existing delete operation retains its delete-marker semantics.Validation covers domain lifecycle/fencing, reservation concurrency, persistence/migrations, endpoint permissions, version-bound downloads, identical-byte replacement, lost responses, delayed cancelled uploads and reconciliation behind a newer unrelated version. All tests, formatting and Sonar Quality Gate pass on
9910ee8(CI run 44596324453). The HTTP regression test covers a Ready record with a missing active version. The first attempt started before NuGet indexed 6.3.1; dependency restoration succeeds after indexing.