Skip to content

Fix resolver session to create independent sessions#2028

Merged
shangyian merged 1 commit intoDataJunction:mainfrom
shangyian:fresh-session
Apr 19, 2026
Merged

Fix resolver session to create independent sessions#2028
shangyian merged 1 commit intoDataJunction:mainfrom
shangyian:fresh-session

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented Apr 19, 2026

Summary

The previous fix (#2024) replaced info.context["session"] with resolver_session() in all GraphQL resolvers, but resolver_session delegated to session_context() which returns request.state.test_session and is set by get_context on every request, not just for tests. This meant all resolvers still shared one session in production, and the concurrent-session crash persisted.

This now calls get_session() directly in production, only reusing the shared session in tests (detected via dependency_overrides).

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 19, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 62f9048
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/69e4a26ab8e59f00085ea02e

@shangyian shangyian changed the title Create a fresh session per resolver to avoid concurrent session conflicts Fix resolver session to create independent sessions Apr 19, 2026
@shangyian shangyian marked this pull request as ready for review April 19, 2026 09:39
@shangyian shangyian merged commit 3f0cb53 into DataJunction:main Apr 19, 2026
15 of 17 checks passed
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