Repository navigation
STOR-5615: Make the Durable Object retry option public - #8143
Conversation
There was a problem hiding this comment.
Superseded by the review of
ce669838.
This review, of 965ee080
💬 Approved with comments — Clean refactor with one WARNING: retry is now validated for every Worker regardless of the autogate. Existing Workers that pass a malformed retry key, which used to be ignored, will now throw, and the commit message does not record this compatibility decision.
Findings: 1 warning (1 is an inline comment on the diff)
Not opened by the correctness review: 2 changed files it was meant to read
types/generated-snapshot/experimental/index.tstypes/generated-snapshot/index.ts
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
🔧 Fix with your agent
Paste the following into your coding agent to investigate and fix these issues.
Fix the following code review issues found in pull request #8143.
Before making changes, review each issue and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g., the fix would require disproportionate changes
for minimal ROI, or the finding is factually incorrect), explain why
- If you need to clarify something before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order
## WARNING (1)
### [Code Quality] `retry` is now validated for every Worker, before the autogate check. Existing non-experimental Workers that pass a malformed `retry` key, which used to be ignored, now throw from get()/getByName()/getExisting(), and the commit message does not record this compatibility decision.
- **File:** src/workerd/api/actor.h:287
📋 Code Quality: ⚠️ 1 warning
The refactor is clean. retry validation now applies to every Worker, not only experimental ones, and happens even with the autogate off.
Recommendation: 📝 Minor Comments
- [WARNING]
retryis now validated for every Worker, before the autogate check. Existing non-experimental Workers that pass a malformedretrykey, which used to be ignored, now throw from get()/getByName()/getExisting(), and the commit message does not record this compatibility decision. (src/workerd/api/actor.h:287)
View full review
retryvalidation is no longer gated (src/workerd/api/actor.h:265-287,src/workerd/api/actor.c++:280-286).- Before: Workers without
experimentalreceived the plainGetDurableObjectOptions, which never readretry, so any value was ignored. The removed test "ignores the retry option without the experimental flag" asserted exactly this. - Now: every
get(),getByName()andgetExisting()call convertsretrythroughtoUserDefinedRetryPolicy, and that happens before theDURABLE_OBJECT_RETRIES_USERLANDcheck. Values such asretry: null,retry: 5,{ maxRetries: '1' }or{ maxRetries: 11 }now throw a TypeError or RangeError. - Wording: the description and the struct comment say the option "applies only while the autogate is on". That is true of applying the policy, but not of validating it.
- Why it matters: the repository's compatibility guidance says autogates do not preserve existing Workers' API surface, and that changes to the API surface should record their compatibility decision in the commit message. The commit message does not record one.
- Fix: either gate the read and the validation behind the autogate or a compatibility flag, or explicitly accept the risk in the commit message.
- Before: Workers without
✅ All other checks passed
🔒 Security: ✅ LGTM
No security issues found.
📖 AGENTS.md: ✅ LGTM
No AGENTS.md issues found.
⚡ Performance: ✅ LGTM
The work in getImpl has the same shape as before. The change adds no new loops, allocations or I/O.
📝 Documentation: ✅ LGTM
No documentation issues found.
Reviewed commit: 965ee080
Workers can now pass `retry` to DurableObjectNamespace's get(), getByName() and getExisting() without the `experimental` flag. The option still applies only while the DURABLE_OBJECT_RETRIES_USERLAND autogate is on. Move `retry` into GetDurableObjectOptions and remove GetDurableObjectOptionsWithRetry and the *WithRetry methods. That struct is also how experimental Workers saw `version` in their types, so GetDurableObjectOptions now has the experimental-only TypeScript override for `version`.
965ee08 to
ce66983
Compare
There was a problem hiding this comment.
💬 Approved with comments — Clean refactor with no correctness, security or performance issues. One INFO remains: the commit message should record the decision that malformed retry values now throw for all Workers.
Findings: 1 info
Not opened by the correctness review: 2 changed files it was meant to read
types/generated-snapshot/experimental/index.tstypes/generated-snapshot/index.ts
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info
Refactor is consistent; one INFO about recording the compatibility decision in the commit message.
Recommendation: 💬 Optional Nits
- [INFO] Lowered to INFO: @apeacock1991 [author] says validating
retryfor every Worker is intended, and the code matches. The commit message still does not record that malformedretryvalues, which used to be ignored, now throw for existing Workers. The repository's backward-compatibility guidance asks for that decision to be stated there explicitly. (src/workerd/api/actor.h:287)
View full review
- Merging
GetDurableObjectOptionsWithRetryintoGetDurableObjectOptionsis consistent across the code, tests and type snapshots:getImplhas a single overload.- The methods are registered without the
experimentalgate. versionstays experimental-only in TypeScript.- The type registration list is updated.
actor-stub-test.wd-testdropsexperimental, so the public path is now under test.- Earlier WARNING, now INFO.
retryis validated throughtoUserDefinedRetryPolicyfor every Worker, before the autogate check.- Lowered to INFO: @apeacock1991 [author] replied that this validation is intended, and
getImplmatches that. - The repository's backward-compatibility guidance asks that changes to the Worker API surface record their compatibility decision in the commit message. The commit message only says the option "applies only while the autogate is on". It does not mention that malformed
retryvalues, which used to be ignored, now throw a TypeError or RangeError for existing Workers. - Adding one sentence that accepts this risk would close the point.
- Lowered to INFO: @apeacock1991 [author] replied that this validation is intended, and
✅ All other checks passed
🔒 Security: ✅ LGTM
retry is still range-checked through toUserDefinedRetryPolicy. The policy is applied only when the DURABLE_OBJECT_RETRIES_USERLAND autogate is on. The jurisdiction and routingMode checks are unchanged.
📖 AGENTS.md: ✅ LGTM
No AGENTS.md issues found.
⚡ Performance: ✅ LGTM
getImpl has the same shape as before. The change adds no loops, allocations or I/O.
📝 Documentation: ✅ LGTM
No documentation issues found.
Reviewed commit: ce669838
Workers can now pass
retrytoDurableObjectNamespace'sget(),getByName()andgetExisting()without theexperimentalflag. The option still applies only while theDURABLE_OBJECT_RETRIES_USERLANDautogate is on.retrymoves intoGetDurableObjectOptions, andGetDurableObjectOptionsWithRetryand the*WithRetrymethods are removed. That struct is also how experimental Workers sawversionin their types, soGetDurableObjectOptionsnow has the experimental-only TypeScript override forversion.The main types snapshot gains
retryandDurableObjectRetryOptions. The experimental snapshot only reorders two declarations.