Repository navigation
fix(den): return reconnect guidance for rejected native Google refreshes - #4524
benjaminshafii wants to merge 13 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
Deploying openwork with
|
| Latest commit: |
cec80d0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://af9cdfbd.openwork.pages.dev |
| Branch Preview URL: | https://fix-den-api-12-native-refres.openwork.pages.dev |
|
Historical clean-dev compatibility control — Passed This is control evidence, not final PR-head evidence. Production source: clean Completed control job · Original test-run artifact 1 test passed; 10 assertion groups passed; 0 failed; 0 skipped; 0 pending judgments. Cold-booted Den and isolated database on the Linux runner; synthetic OAuth/Google/Graph endpoints. No production services used. Reproduction on clean dev with the two witness files overlaid: OPENWORK_EVAL_NATIVE_GOOGLE_REFRESH=1 OPENWORK_EVAL_NATIVE_REFRESH_COMPATIBILITY_ONLY=1 pnpm evals:pr specs/native-google-refresh-recovery.test.tsThis mode checks unchanged valid behavior for both real default resolvers. It intentionally excludes the six PR-only rejected-grant assertion groups; it does not claim that clean dev already returns the new 409 behavior.
The temporary baseline matrix was removed after this one-off comparison. The permanent required job verifies only the current PR head; its fresh evidence is published separately. No security check was suppressed or weakened. |
Test evidence — native-google-refresh-and-microsoft-compatibility-preserve-reconnect-and-disconn — ✅ passedSHA b7a646b · engine v1 ✅ passed · 16 expectations passed · 0 failed · 0 pending verdict passed · 0 user observations · 0 probes · steps 0/0 ℹ️ ASSERTION — 1. google-workspace: Repeated revoked grants return 409 without mailbox accessThree explicit reads made exactly three refresh attempts and no mailbox requests. Status continued to report connected: true: retained credentials are an existing UI-status limitation, not a claim of durable invalidation.
ℹ️ ASSERTION — 2. google-workspace: Temporary failures preserve recoveryProvider unavailability retained the existing error classification (Google 500; Microsoft 502). The next read refreshed successfully without another authorization.
ℹ️ ASSERTION — 3. google-workspace: Fresh credentials avoid token-endpoint workTwo valid-token mail reads succeeded without any refresh attempt.
ℹ️ ASSERTION — 4. google-workspace: Concurrent successful refreshes retain a usable successorTwo held successful refresh responses completed concurrently; both waiting reads succeeded. A later read succeeded without another refresh and used a credential fingerprint observed on the concurrent mailbox reads.
ℹ️ ASSERTION — 5. google-workspace: successful refresh cannot overwrite reconnectA new authorization completed while the old refresh was held. The waiting read and a subsequent read used the exact replacement credential fingerprint, without another refresh.
ℹ️ ASSERTION — 6. google-workspace: Disconnect wins over successful refreshDisconnect completed before the held token response. Both waiting and later reads required connection, status remained disconnected, and no mail call or additional refresh occurred.
ℹ️ ASSERTION — 7. google-workspace: invalid_grant cannot overwrite reconnectA new authorization completed while the old refresh was held. The waiting read and a subsequent read used the exact replacement credential fingerprint, without another refresh.
ℹ️ ASSERTION — 8. google-workspace: Disconnect wins over invalid_grantDisconnect completed before the held token response. Both waiting and later reads required connection, status remained disconnected, and no mail call or additional refresh occurred.
ℹ️ ASSERTION — 9. microsoft-365: Repeated revoked grants return 409 without mailbox accessThree explicit reads made exactly three refresh attempts and no mailbox requests. Status continued to report connected: true: retained credentials are an existing UI-status limitation, not a claim of durable invalidation.
ℹ️ ASSERTION — 10. microsoft-365: Temporary failures preserve recoveryProvider unavailability retained the existing error classification (Google 500; Microsoft 502). The next read refreshed successfully without another authorization.
ℹ️ ASSERTION — 11. microsoft-365: Fresh credentials avoid token-endpoint workTwo valid-token mail reads succeeded without any refresh attempt.
ℹ️ ASSERTION — 12. microsoft-365: Concurrent successful refreshes retain a usable successorTwo held successful refresh responses completed concurrently; both waiting reads succeeded. A later read succeeded without another refresh and used a credential fingerprint observed on the concurrent mailbox reads.
ℹ️ ASSERTION — 13. microsoft-365: successful refresh cannot overwrite reconnectA new authorization completed while the old refresh was held. The waiting read and a subsequent read used the exact replacement credential fingerprint, without another refresh.
ℹ️ ASSERTION — 14. microsoft-365: Disconnect wins over successful refreshDisconnect completed before the held token response. Both waiting and later reads required connection, status remained disconnected, and no mail call or additional refresh occurred.
ℹ️ ASSERTION — 15. microsoft-365: invalid_grant cannot overwrite reconnectA new authorization completed while the old refresh was held. The waiting read and a subsequent read used the exact replacement credential fingerprint, without another refresh.
ℹ️ ASSERTION — 16. microsoft-365: Disconnect wins over invalid_grantDisconnect completed before the held token response. Both waiting and later reads required connection, status remained disconnected, and no mail call or additional refresh occurred.
Test run created 2026-09-05T22:50:52.082Z · Source: |
A native Google capability call with a rejected OAuth refresh grant returned
500 internal_server_error. The shared resolver now returns the existing actionable409 needs_connectionresponse, or reuses a newer valid credential if another refresh or reconnect has already saved one. Microsoft 365 also uses this resolver; its rejected-grant response changes from 502 to 409.Only
oauth_invalid_grantis handled as reconnect. Other token failures retain their existing behavior. The error path never clears credentials, so a stale rejection cannot erase a newer grant or invalidate another worker's pending persistence. There is no automatic retry inside the request. Explicit later requests still try the retained grant, and status still reportsconnected: truewhile an access token is stored; this existing status limitation is now asserted, not claimed fixed.Related Sentry issue: DEN-API-12. The production-tagged
den-api.localURL is used by internal MCP invocation and does not alone establish test traffic. The historical reason Google rejected the grant remains unknown. This native-provider path is distinct from #4441's OpenWork-issued MCP refresh grants.Validation:
b7a646b03201a3aca6391c7f92dabe555096a62c. Passed: 1 test, 16 assertion groups, 0 failures, 0 skips, 0 pending judgments. Final-head proof job; matching-SHA evidence. The concurrency check verifies credential reuse without another refresh. The historical compatibility-only switch has been removed: rejected-grant cases always run.OPENWORK_EVAL_NATIVE_GOOGLE_REFRESH=1 pnpm evals:pr specs/native-google-refresh-recovery.test.ts.aadaff1530fc5a80a7fff8671a5c3266aa62d989, 1 test and 10 unchanged-behavior assertion groups passed, zero skips. Only the test and synthetic fixture were overlaid; this historical control predates the additional concurrency persistence assertions and removal of the compatibility-only switch in the final candidate. The control deliberately excludes the new rejected-grant semantics.12563e7e897ce47d654e8e9c0db23906612cff88returned 500 where 409 was required: failing control job.85a5dfccb4d74732593628ab4cc8912f8b88283d; no baseline was weakened.Remaining gaps: strict provider refresh-token rotation, omitted refresh-token responses, tenant/client rotation or member removal during refresh, cross-member/connector isolation, desktop reconnect-card behavior, and latency/load measurements. Those behaviors are not claimed proven by this journey. All fixtures and published evidence are synthetic; no production payloads or credentials are used.