Repository navigation
Conversation
…onnection RPC scope authorization decoded the settings payload a second time after the RPC server had already decoded it. Duration intervals were already Duration objects, so the second decode threw, and because the throw was synchronous inside middleware the server reported it as a connection defect. Authorization now reads the decoded payload directly, the same applies to asset URLs and the prepare pull request thread scope check, and scope calculation runs inside Effect.suspend so a throw fails only its request. Fixes pingdotgg#17233
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughRPC authorization now uses already-decoded payloads to select scopes and suspends per-request scope calculation. A regression test covers settings updates with duration values. ChangesRPC Authorization
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue remains from this review; the change is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change preserves existing permission checks and is designed to prevent one failed request from disrupting the connection. No introduced security weakness was established, but complete request-failure and interruption behavior remains unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Note Written by Hi! We are cleaning up open PRs, and this one does not say which model or harness was used to create it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model and harness in the PR description. |
Fixes #17233
Problem
Changing anything under Settings → General → Background activity → Advanced (for example turning off Pause when locked) failed with "Setting not saved", and the environment connection dropped and reconnected. The same happened for the Git fetch and provider health check intervals and Restore defaults.
RpcScopeAuthorizationdecoded theserverUpdateSettingspayload withSchema.decodeUnknownSyncafter the RPC server had already decoded it. The patch'sDurationFromMillisfields were alreadyDurationobjects, so the second decode threwSchemaError: Expected number at ["patch"]["backgroundActivity"]["overrides"]["automaticGitFetchInterval"]. The throw happened synchronously while the RPC server applied middleware, so it was reported as a connection-level defect and the client failed every pending request on that socket.Fix
RpcAuthorization.tsreads the payload the RPC server already decoded, typed from the RPC definition, instead of decoding it again. The same change applies toassetsCreateUrl.Effect.suspend, so a future throw there fails only its own request. The/wsserver setsdisableFatalDefects, so it no longer takes the connection down.clientRpcRequiredScopesno longer decodes thegitPreparePullRequestThreadinput again. Its schema has no transforms today, so it wasn't broken, but it had the same trap. Web, mobile and the server all call it with already-decoded input.backgroundActivity.overrides, sent through the real authorization middleware. It fails with the error from the issue before this change and passes after.A sweep of server, contracts, client-runtime, web and mobile found no other place where a transforming schema is decoded twice in a way that throws.