Skip to content

Harden reliability, remove global mutable state, fix test flakiness#16

Merged
ryanbas21 merged 2 commits into
mainfrom
feat/hardening-and-reliability
May 12, 2026
Merged

Harden reliability, remove global mutable state, fix test flakiness#16
ryanbas21 merged 2 commits into
mainfrom
feat/hardening-and-reliability

Conversation

@ryanbas21
Copy link
Copy Markdown
Owner

Summary

  • Remove configureDevtools global singleton — options are now passed through call sites, eliminating shared mutable state that could leak between SDK instances
  • Harden runtime safety — cap __PING_DEVTOOLS_STATE__ at 500 entries, guard localStorage/cookie access for privacy modes, add origin check to content relay, defensive guards for snapshot loading and event-store hydration
  • Fix e2e test flakiness — replace waitForTimeout with Playwright toPass() retry assertions, properly await mock server close
  • Fix CORS detector false positivecredentials-mismatch now only flags when the request actually sends credentials (Cookie/Authorization)
  • Fix PKCE annotation — remove hard-coded challengeMethod: 'S256' from token annotator (only the authorize request knows the method)
  • Fix service worker lifecycle — rehydrate on module evaluation (runs every SW wake) instead of activate (fires once)
  • Pin GitHub Actions to commit SHAs for supply-chain security
  • VS Code extension cleanup — dispose ManagedRuntime on deactivate, reject pending CDP calls on disconnect, exclude webview from tsconfig
  • Build config fixes — add missing devtools-core and vscode-extension to root tsconfig references, fix devtools-ui ports export

Test plan

  • Run pnpm test across all packages to verify unit tests pass
  • Run e2e tests to confirm flakiness fixes
  • Verify CORS detector only flags credentials-mismatch when credentials are present
  • Verify extension loads and rehydrates state after service worker restart

🤖 Generated with Claude Code

ryanbas21 and others added 2 commits May 11, 2026 18:03
…ness

- Remove configureDevtools global singleton; pass DevtoolsOptions through
  call sites to eliminate shared mutable state
- Cap __PING_DEVTOOLS_STATE__ at 500 entries to prevent memory leaks
- Guard localStorage/cookie access with try-catch for privacy modes
- Pin GitHub Actions to commit SHAs for supply-chain security
- Replace waitForTimeout with Playwright toPass/expect retries in e2e tests
- Fix CORS credentials-mismatch false positive when no credentials sent
- Remove hard-coded PKCE challengeMethod from token annotator
- Add origin check to content relay for defense-in-depth
- Fix service worker rehydration (module-eval vs activate lifecycle)
- Add defensive guards for snapshot loading and event-store hydration
- Clean up CDP client disconnect (reject pending calls, clear state)
- Properly dispose ManagedRuntime on VS Code extension deactivate
- Add devtools-core and vscode-extension to root tsconfig references
- Fix devtools-ui ports export to use .ts source

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… consolidate BridgeHandle

BREAKING CHANGE: `attachDevToolsBridge` is now `attachDaVinciBridge`.
`BridgeHandle` is the single shared type for all bridges (replaces
`JourneyBridgeHandle` and `OidcBridgeHandle`). File renamed from
`bridge.ts` to `davinci-bridge.ts`.

Also adds missing test coverage:
- Ring buffer cap (emit.ts splices at 500 entries)
- Cache/responseBody passthrough via client.cache.getCache
- Cookie diff tracking (session:cookie events)
- Multi-key storage diffs in a single transition
- Multi-bridge coexistence (independent event streams)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ryanbas21 ryanbas21 force-pushed the feat/hardening-and-reliability branch from 33b85fa to 546f82e Compare May 12, 2026 00:34
@ryanbas21 ryanbas21 merged commit 52d7bfa into main May 12, 2026
1 check passed
@ryanbas21 ryanbas21 deleted the feat/hardening-and-reliability branch May 12, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant