Repository navigation
Upgrade WebKit to fc9f2fa7272fec64905df6a9c78e15d7912f14ca #28371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
711c48b
28319ea
14276e7
1e0a544
7ded174
e02fb85
9517394
37540b2
4191da1
bd2e5f4
ca4668b
c1c0cbe
9a8b09a
ee23ee5
2f825a0
08364ad
cabf10d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -273,10 +273,10 @@ void Bun__SecretsJobOptions__runFromJS(SecretsJobOptions* opts, JSGlobalObject* | |
| if (opts->error.type == Secrets::ErrorType::NotFound) { | ||
| if (opts->op == SecretsJobOptions::GET) { | ||
| // For GET operations, NotFound resolves with null | ||
| RELEASE_AND_RETURN(scope, promise->resolve(global, jsNull())); | ||
| RELEASE_AND_RETURN(scope, promise->resolve(global, vm, jsNull())); | ||
| } else if (opts->op == SecretsJobOptions::DELETE_OP) { | ||
| // For DELETE_OP operations, NotFound means we return false | ||
| RELEASE_AND_RETURN(scope, promise->resolve(global, jsBoolean(false))); | ||
| RELEASE_AND_RETURN(scope, promise->resolve(global, vm, jsBoolean(false))); | ||
| } | ||
| } | ||
| JSValue error = opts->error.toJS(vm, global); | ||
|
Comment on lines
273
to
282
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟣 Pre-existing bug: Bun.secrets.delete(service, name) fails silently when called with two positional string arguments because case DELETE_OP: falls through to case SET: which requires 3 positional args instead of 2. This is a pre-existing issue unrelated to this PR's WebKit upgrade changes. Extended reasoning...What the bug isIn SecretsJobOptions::fromJS() (JSSecrets.cpp), the case DELETE_OP: label has no body and falls through to case SET:. The shared positional-argument path inside that combined block checks args.size() > 2, requiring three string arguments (service, name, value). But DELETE_OP only needs two arguments (service + name) — there is no value to delete. So any call like Bun.secrets.delete("myService", "myKey") with two positional strings skips the fast path entirely and falls into fromOptionsObject(), which throws "Expected options to be an object" because the second argument is a string, not an options object. The specific code path0 ""0 ""0 ""1 "/usr/include/stdc-predef.h" 1 3 40 "" 21 ""By contrast, case GET: correctly uses args.size() > 1 in its own branch, requiring only 2 string args. Why existing code does not prevent itThe fall-through is intentional for the options-object form (both SET and DELETE can accept {service, name, value} / {service, name} objects), but the positional-argument guard was written with only SET in mind (which genuinely needs 3 args: service, name, value). Nobody added a separate positional check for DELETE_OP that needs only 2. ImpactAny caller using the convenient Bun.secrets.delete('service', 'name') positional form receives a runtime error instead of a successful deletion. The options-object form Bun.secrets.delete({ service: 'x', name: 'y' }) works correctly. This is a silent behavioral regression for users who follow the documented positional API. Step-by-step proof
How to fix itGive DELETE_OP its own case block before SET:, mirroring the GET: pattern but checking args.size() > 1: 0 ""0 ""0 ""1 "/usr/include/stdc-predef.h" 1 3 40 "" 21 ""Pre-existing classificationThis PR's only change to JSSecrets.cpp is updating promise->resolve(global, value) to promise->resolve(global, vm, value) to match the new WebKit JSPromise API. The argument-parsing logic in fromJS() was not touched by this PR. |
||
|
|
@@ -306,7 +306,7 @@ void Bun__SecretsJobOptions__runFromJS(SecretsJobOptions* opts, JSGlobalObject* | |
| break; | ||
| } | ||
| RETURN_IF_EXCEPTION(scope, ); | ||
| RELEASE_AND_RETURN(scope, promise->resolve(global, result)); | ||
| RELEASE_AND_RETURN(scope, promise->resolve(global, vm, result)); | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: oven-sh/bun
Length of output: 239
Do not merge until the WebKit release is published.
The WEBKIT_VERSION is updated to
fc9f2fa7272fec64905df6a9c78e15d7912f14ca, but the corresponding release tagautobuild-fc9f2fa7272fec64905df6a9c78e15d7912f14cadoes not exist in oven-sh/WebKit. The build will fail when attempting to download prebuilt artifacts. The WebKit prebuilts must be built and published to the release page before this change can merge.🤖 Prompt for AI Agents