Repository navigation
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This focused bug fix prevents double-decoding of transformed RPC payloads and adds regression coverage, but it changes production authorization middleware and connection-level failure handling. Changes under the server auth directory require human review. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
…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, project mutations, and the prepare pull request thread scope check. Scope calculation runs inside Effect.suspend so a throw fails only its request. Fixes pingdotgg#17233
cbbf7e5 to
9aecd4d
Compare
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 toassetsCreateUrlandprojectsMutate.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.
Supersedes #17250, which was closed for not listing the model and harness. Rebased on current
main.Written by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, running in T3 Code. Reviewed by GPT-6.1-Sol (gpt-6.1-sol) in Codex, running in T3 Code.