Skip to content

refactor(state): add effectful ScopedState#17231

Closed
kitlangton wants to merge 2 commits intoeffect-auth-provider-flowfrom
effect-scoped-state
Closed

refactor(state): add effectful ScopedState#17231
kitlangton wants to merge 2 commits intoeffect-auth-provider-flowfrom
effect-scoped-state

Conversation

@kitlangton
Copy link
Contributor

Summary

  • add a real ScopedState effectful data type built on ScopedCache
  • cover root-based caching, invalidation, concurrency, and scope cleanup with focused tests
  • move ProviderAuthService onto ScopedState so it no longer depends on Instance.state directly

Add a real effect-style scoped state data type built on ScopedCache and cover its caching, invalidation, concurrency, and scope-finalization semantics with focused tests. Move ProviderAuthService onto the new abstraction so the service no longer depends on Instance.state directly.
Replace the generic ScopedState (keyed by caller-provided root) with
InstanceState that hardcodes Instance.directory and integrates with
the instance dispose/reload lifecycle via a global task registry.

- Parallelize State + InstanceState disposal in reload/dispose
- Use Effect's Record.map and Struct.pick in auth-service
- Flatten nested Effect.gen in OAuth callback flow
- Add docstrings to ProviderAuthService interface
- Add State and InstanceState tests
@kitlangton
Copy link
Contributor Author

Folded into #17227

@kitlangton kitlangton closed this Mar 12, 2026
@kitlangton kitlangton deleted the effect-scoped-state branch March 12, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant