diff --git a/dltlyse/core/analyser.py b/dltlyse/core/analyser.py index adfda08..a6aae45 100644 --- a/dltlyse/core/analyser.py +++ b/dltlyse/core/analyser.py @@ -32,7 +32,14 @@ ] # Traces to buffer since they might be stored before lifecycle start message -BUFFER_MATCHES_MSG = {"apid": "DA1", "ctid": "DC1", "payload_decoded": "[connection_info ok] connected \00\00\00\00"} +BUFFER_MATCHES_MSG = { + "apid": "DA1", + "ctid": "DC1", + # Note there is a trailing space at the end of the str. The reason is due to an + # optimization that compares (using `__eq__` aka `==`) the exact string that gets + # extracted by python-dlt now with stripped nul bytes (\00) that existed before. + "payload_decoded": "[connection_info ok] connected ", +} BUFFER_MATCHES_ECUID = "XORA" DLT_LIFECYCLE_START = { "apid": "DLTD", diff --git a/tests/unittests/test_analyser.py b/tests/unittests/test_analyser.py index 0ea513b..3efd659 100644 --- a/tests/unittests/test_analyser.py +++ b/tests/unittests/test_analyser.py @@ -306,7 +306,7 @@ def test_run_analyse_call_plugin_with_exception(): def test_run_analyse_buffer_traces(): """Test to append traces to buffer""" dlt_msgs = [ - MockDLTMessage(apid="DA1", ctid="DC1", payload="[connection_info ok] connected \00\00\00\00"), + MockDLTMessage(apid="DA1", ctid="DC1", payload="[connection_info ok] connected "), MockDLTMessage(ecuid="XORA"), ]