refactor: remove unused SharedSession helper (#77)#86
Merged
Conversation
SharedSession was never imported or instantiated by production code or tests. Session ownership is handled directly by AiohttpRestAdapter and AiohttpWebSocketAdapter, so the helper served no runtime purpose and was the sole reason config.py needed to import aiohttp. Delete the class, drop the now-unused aiohttp import, and tighten the module docstring accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #77.
Issue assessment
Valid and actionable. Verified that
SharedSession(defined atsrc/haclient/config.py:131-150onmain) has no importers or instantiations anywhere in the codebase or test suite. Session ownership lives directly insideAiohttpRestAdapterandAiohttpWebSocketAdapter, so the helper was pure dead code, and was the only reasonconfig.pyimportedaiohttp.Fix
SharedSessionclass fromsrc/haclient/config.py.import aiohttp.No production code paths or public re-exports change (
SharedSessionwas never exported fromhaclient.__init__).Checks run
ruff check src tests— cleanruff format --check src tests— clean (57 files already formatted)mypy src— Success: no issues found in 38 source filespytest tests/ --cov=haclient --cov-report=term-missing --cov-fail-under=95— 316 passed, coverage 97.18% (above the 95% gate)