Skip to content

fix: polyfill Buffer for AWS request signing in V8 - #76

Open
AdamAmr05 wants to merge 1 commit into
get-convex:mainfrom
AdamAmr05:agent/fix-v8-buffer-signing
Open

fix: polyfill Buffer for AWS request signing in V8#76
AdamAmr05 wants to merge 1 commit into
get-convex:mainfrom
AdamAmr05:agent/fix-v8-buffer-signing

Conversation

@AdamAmr05

Copy link
Copy Markdown

hello convex friends, this fixes #62.

Some AWS SDK versions allowed by the component’s dependency range require a global Buffer during SigV4 signing. Convex’s default V8 runtime does not provide one, causing R2 operations such as metadata synchronization to fail after an upload reaches the bucket.

This adds the browser-compatible buffer package at the shared R2 client boundary and regression coverage in the repository’s Edge-runtime test environment.

@AdamAmr05
AdamAmr05 marked this pull request as ready for review July 30, 2026 19:25
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: get-convex/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 01e64138-d825-4b33-9799-088df76919e9

📥 Commits

Reviewing files that changed from the base of the PR and between 52b5cbf and 18f3f86.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • src/client/index.test.ts
  • src/shared.ts

📝 Walkthrough

Walkthrough

The package adds buffer as a runtime dependency. Shared initialization imports its Buffer implementation and assigns it to globalThis.Buffer when the global is unavailable. Client tests simulate the edge runtime, reload the shared client factory, verify Buffer initialization, and send a HeadObjectCommand through middleware that rejects with a sentinel error.

Suggested reviewers: ianmacartney

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a Buffer polyfill for AWS request signing in the V8 runtime.
Description check ✅ Passed The description matches the implemented fix and regression coverage for the V8 Buffer issue.
Linked Issues check ✅ Passed The changes add a Buffer polyfill at the shared R2 client boundary and test it, which addresses issue #62's signing failure in V8.
Out of Scope Changes check ✅ Passed The dependency bump, shared polyfill, and test updates all align with the Buffer signing fix and do not appear out of scope.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buffer is not defined in lib:syncMetadata when running in V8 runtime

1 participant