Skip to content

fix: Request-scoped session exposes no post-commit hook, so module caches refresh against uncommitted state - #278

Draft
antosubash wants to merge 1 commit into
mainfrom
pi/issue-268-request-scoped-session-exposes-no-post-c
Draft

fix: Request-scoped session exposes no post-commit hook, so module caches refresh against uncommitted state#278
antosubash wants to merge 1 commit into
mainfrom
pi/issue-268-request-scoped-session-exposes-no-post-c

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Closes#268

Headless Pi worker

This is a draft pull request created from an issue carrying the approval label.
It is never merged automatically and requires human review.

Agent summary

Summary

  • Added RequestSession.on_commit(callback) supporting sync and async callbacks.
  • Callbacks run only after successful commits; rollback/read-only/failed commits discard them.
  • Callback failures are logged without affecting committed responses or later callbacks.
  • Exported the new session/callback types and documented usage.

Changed areas

  • DB session/finalization runtime
  • Framework DB public API
  • Session documentation and changelog
  • Transaction/session tests

Verification

  • uv run pytest framework/db/tests69 passed
  • Ruff format/check — passed
  • uv run ty check ...passed
  • uv run python scripts/check_file_size.pypassed
  • git diff --checkpassed

Visual evidence: none required.

Risks/blockers: none.

Local visual evidence

When requested, screenshots, traces, videos, and GIFs are stored only under the worker worktree's ignored
.qa/issues/268/ directory. GitHub CLI cannot attach those files; inspect them on the worker host
or attach selected evidence manually.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying simple-module-python with Cloudflare Pages Cloudflare Pages

Latest commit:0fd49e9
Status: ✅ Deploy successful!
Preview URL:https://4a624509.simple-module-python.pages.dev
Branch Preview URL:https://pi-issue-268-request-scoped.simple-module-python.pages.dev

View logs

@antosubash

Copy link
Copy Markdown
OwnerAuthor

✅ CI checks passed for this pull request.

Sign up for freeto 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.

Request-scoped session exposes no post-commit hook, so module caches refresh against uncommitted state

1 participant

@antosubash