Skip to content

fix(sfs): pass file_id instead of s3 key to mark_uploaded#2738

Merged
ehayes2000 merged 1 commit into
mainfrom
push-mxrkzlmqznxy
Apr 22, 2026
Merged

fix(sfs): pass file_id instead of s3 key to mark_uploaded#2738
ehayes2000 merged 1 commit into
mainfrom
push-mxrkzlmqznxy

Conversation

@ehayes2000
Copy link
Copy Markdown
Contributor

@ehayes2000 ehayes2000 commented Apr 21, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Warning

Rate limit exceeded

@ehayes2000 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 0 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 45 minutes and 0 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9d431d17-c685-440c-b2bf-4b2d5767bba4

📥 Commits

Reviewing files that changed from the base of the PR and between e695aab and bb738ab.

📒 Files selected for processing (1)
  • rust/cloud-storage/static_file_service/src/api/event/s3_create.rs
📝 Walkthrough

Walkthrough

The S3 create event handler now extracts a file_id from the S3 object key via parsing, with fallback to the raw key. The DynamoDB update call is modified to use the derived file_id instead of the raw S3 key string, and an error message is corrected.

Changes

Cohort / File(s) Summary
S3 Create Event Handler
rust/cloud-storage/static_file_service/src/api/event/s3_create.rs
Modified handle_s3_create to parse S3 object key into file_id using s3_key::StaticFileKey::from_s3_key() with fallback to raw key. Updated DynamoDB mark_uploaded call to use derived file_id. Corrected error context message to remove duplicate "not".
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided by the author, making it impossible to assess relatedness to the changeset. Add a pull request description that explains the bug being fixed, the solution implemented, and any relevant context for reviewers.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with 'fix:' prefix, is under 72 characters (57 chars), and accurately describes the main change of passing file_id instead of s3 key to mark_uploaded.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@rust/cloud-storage/static_file_service/src/api/event/s3_create.rs`:
- Around line 7-9: The current fallback of using the raw S3 key when
StaticFileKey::from_s3_key fails will reintroduce the ghost-row bug; change the
logic in s3_create.rs so that StaticFileKey::from_s3_key(errors) are not
silently ignored but cause the handler to fail loudly: replace the
unwrap_or_else fallback on StaticFileKey::from_s3_key(&event.s3.object.key) with
explicit error handling that logs the parse failure (including the problematic
event.s3.object.key and the parse error) and returns an Err/early failure from
the handler so mark_uploaded is never called with an invalid file_id; reference
the StaticFileKey::from_s3_key call and the subsequent use of
file_id/mark_uploaded when making this change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9b5bac3f-4b77-4f8b-889f-8459879a9b17

📥 Commits

Reviewing files that changed from the base of the PR and between e5727e4 and e695aab.

📒 Files selected for processing (1)
  • rust/cloud-storage/static_file_service/src/api/event/s3_create.rs

Comment thread rust/cloud-storage/static_file_service/src/api/event/s3_create.rs Outdated
@ehayes2000 ehayes2000 merged commit 22813f8 into main Apr 22, 2026
39 checks passed
@ehayes2000 ehayes2000 deleted the push-mxrkzlmqznxy branch April 22, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant