From ffb840f1eccb01f528d4b3e5fce1fab75c69ef39 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Wed, 16 Apr 2025 19:33:20 +0200 Subject: [PATCH] fixup! chore(python): fix filters and expected vs actual responses --- python/src/trezorlib/debuglink.py | 1 - python/src/trezorlib/transport/session.py | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/src/trezorlib/debuglink.py b/python/src/trezorlib/debuglink.py index 917a2377ff..44e49b705f 100644 --- a/python/src/trezorlib/debuglink.py +++ b/python/src/trezorlib/debuglink.py @@ -1003,7 +1003,6 @@ class SessionDebugWrapper(Session): msg = self._session._read() if isinstance(self.client, TrezorClientDebugLink): msg = self.client._filter_message(msg) - self.client.notify_read(msg) return msg def resume(self) -> None: diff --git a/python/src/trezorlib/transport/session.py b/python/src/trezorlib/transport/session.py index d101a04e49..e85d870687 100644 --- a/python/src/trezorlib/transport/session.py +++ b/python/src/trezorlib/transport/session.py @@ -200,7 +200,13 @@ class SessionV1(Session): assert self.client._last_active_session is self if t.TYPE_CHECKING: assert isinstance(self.client.protocol, ProtocolV1Channel) - return self.client.protocol.read() + resp = self.client.protocol.read() + + from ..debuglink import TrezorClientDebugLink + + if isinstance(self.client, TrezorClientDebugLink): + self.client.notify_read(resp) + return resp def init_session(self, derive_cardano: bool | None = None) -> None: if self.id == b"":