aleph-im / aleph-sdk-python

Python SDK library for the Aleph.im network
MIT License
3 stars 5 forks source link

Fix 146: Autenticated client was overriding the manager and it was causing issue #149

Closed olethanh closed 1 month ago

olethanh commented 1 month ago

…using issue

github-actions[bot] commented 1 month ago

Summary: This PR introduces a refactoring of the asynchronous context management methods in the AuthenticatedAlephHttpClient and AlephHttpClient classes. The changes include:

  1. Removing the __aenter__ method from AuthenticatedAlephHttpClient.
  2. Modifying the __aexit__ method in AlephHttpClient to ensure the HTTP session is closed only if it has been initialized.

Explanation: The removal of the __aenter__ method from AuthenticatedAlephHttpClient simplifies the class and removes unnecessary functionality. The modification in AlephHttpClient ensures that the HTTP session is properly closed even in case of an error, preventing potential resource leaks.

These changes are significant as they affect the handling of asynchronous operations and resource management, which could potentially impact the stability and performance of the application. Therefore, a thorough review is advised to ensure compatibility with existing workflows and to minimize the risk of introducing bugs.