Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing header return in _populate_available_source_ids. #335

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

axlan
Copy link
Collaborator

@axlan axlan commented Aug 27, 2024

Fix crash when self.return_header is False.

Traceback (most recent call last):
  File "/home/jdiamond/src/nautilus/./point_one/platform/quectel-lg69t-evb/p1_runner/bin/extract_storage.py", line 215, in <module>
    main()
  File "/home/jdiamond/src/nautilus/./point_one/platform/quectel-lg69t-evb/p1_runner/bin/extract_storage.py", line 127, in main
    reader = MixedLogReader(input_path, message_types=(VersionInfoMessage,), return_header=False, return_bytes=True)
  File "/home/jdiamond/src/nautilus/venv_host_tools/lib/python3.10/site-packages/fusion_engine_client/parsers/mixed_log_reader.py", line 125, in __init__
    self._populate_available_source_ids()
  File "/home/jdiamond/src/nautilus/venv_host_tools/lib/python3.10/site-packages/fusion_engine_client/parsers/mixed_log_reader.py", line 643, in _populate_available_source_ids
    self.available_source_ids.add(header.source_identifier)
AttributeError: 'PlatformStorageDataMessage' object has no attribute 'source_identifier'

@axlan axlan requested a review from adamshapiro0 August 27, 2024 22:17
@axlan axlan self-assigned this Aug 27, 2024
@@ -627,6 +627,8 @@ def get_available_source_ids(self) -> Set[int]:

def _populate_available_source_ids(self, num_messages_to_read: int = 10):
self.available_source_ids = set()
stored_return_header = self.return_header
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the issue here, is it a recursion thing or something? I'd definitely recommend a comment explaining this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing complicated, the lines in this function:

                    result = self.read_next()
                    header = result[0]

assume the header is returned.

Copy link
Collaborator

@adamshapiro0 adamshapiro0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but please leave a note.

@axlan axlan merged commit 6155f83 into master Aug 27, 2024
14 checks passed
@axlan axlan deleted the fix-missing-header-return branch August 27, 2024 22:47
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.

2 participants