Skip to content

fix: close owned Aptos clients on SDK shutdown - #21

Open
zakazaka95 wants to merge 1 commit into
decibeltrade:mainfrom
zakazaka95:fix/close-aptos-rest-client
Open

zakazaka95 wants to merge 1 commit into
decibeltrade:mainfrom
zakazaka95:fix/close-aptos-rest-client

Conversation

@zakazaka95

Copy link
Copy Markdown

BaseSDK and DecibelReadDex each create an Aptos RestClient, which owns a separate httpx.AsyncClient. Their close methods leave that client open, including when exiting an async context manager.

Close the owned Aptos client as well. Keep cleanup running if another close fails, and preserve the existing rule that a caller-provided HTTP client stays open.

Validation on Python 3.11.15 with the frozen lockfile:

  • All 12 new lifecycle/error-path regressions fail on the original source; 141 focused tests and all 1,283 selected offline tests pass after the fix (67 testnet cases deselected).
  • All four CLAUDE.md gates pass: ruff lint, format, strict pyright and the non-testnet suite. Source and wheel builds pass, retaining existing backend-version/license-classifier warnings.
  • Independent review and lifecycle rerun pass. The sole open feat: support local fee payer sponsorship while preserving gas station defaults #17 changes fee sponsorship and does not cover client cleanup.

The lifecycle tests use real local HTTP client state without sending network requests. No live account, API key or transaction is needed.

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