Skip to content

Resolve merge conflicts for Propagate main to stripe - #235

Merged
chriscarrollsmith merged 3 commits into
stripefrom
cursor/resolve-stripe-propagate-c437
Jul 29, 2026
Merged

Resolve merge conflicts for Propagate main to stripe#235
chriscarrollsmith merged 3 commits into
stripefrom
cursor/resolve-stripe-propagate-c437

Conversation

@chriscarrollsmith

@chriscarrollsmith chriscarrollsmith commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Resolves merge conflicts from #234 (Propagate main to stripe) so main's engine-cache fix can land on stripe
  • In main.py, keep Stripe billing imports/validate_billing_environment and add clear_engine_cache() on app shutdown
  • In utils/core/db.py, keep main's shared/locked engine cache (drop the stripe-era singleton), and combine set_up_db so it still runs sync_default_role_permissions inside try/finally dispose

Conflict files

  • main.py
  • utils/core/db.py

Test plan

  • uv run ty check . — all checks passed
  • uv run pytest tests --ignore=tests/browser — 524 passed
  • Confirm this PR is mergeable into stripe and supersedes Propagate main to stripe #234
Open in Web Open in Cursor 

github-actions and others added 3 commits July 14, 2026 21:40
Automatically generated by python-semantic-release
* fix: engine too many connections

Fix create_engine() connection leaks per request/call

* refactor: use lru cached engine

Use lru cached engine

* add pool_pre_ping and dispose()

* fix: address review feedback on engine cache

- Route rate_limit.py through the shared get_engine() cache instead of
  its own module-level singleton, so no second unmanaged pool survives
  clear_engine_cache() or goes stale when the connection URL changes.
- Guard the engine cache with a threading.Lock: sync dependencies run in
  FastAPI's threadpool, so concurrent first requests could race in
  get_engine() and orphan an undisposed engine, and clear_engine_cache()
  could hit a dict-mutated-during-iteration error.
- Remove the clear_engine_cache() side effect from tear_down_db(); test
  fixtures that relied on it now call it explicitly in their teardown.
- Make engine-cache tests isolation-safe via an engine_cache fixture so
  cleanup runs even when an assertion fails mid-test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Rafiuzzaman Khan <rafiuzzamank@gmail.com>
Co-authored-by: chriscarrollsmith <chriscarrollsmith@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…ng conflicts

Keep main's shared engine cache and clear_engine_cache lifespan cleanup
alongside stripe billing imports, and retain sync_default_role_permissions
in set_up_db with try/finally dispose.

Co-authored-by: Christopher Carroll Smith <chriscarrollsmith@users.noreply.github.com>
@chriscarrollsmith
chriscarrollsmith marked this pull request as ready for review July 29, 2026 20:59
@chriscarrollsmith
chriscarrollsmith merged commit 040f634 into stripe Jul 29, 2026
2 checks passed
@chriscarrollsmith
chriscarrollsmith deleted the cursor/resolve-stripe-propagate-c437 branch July 29, 2026 20:59
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.

3 participants