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

Bufix: set last ID before asking for more data so we know if we get stuck #29

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

garethpotter
Copy link
Collaborator

No description provided.

@@ -848,6 +848,7 @@ int thingset_bin_import_data_progressively(struct thingset_context *ts, uint8_t
ts->decoder->payload = ts->msg;
ts->decoder->elem_count = state.elem_count;
*consumed = successfully_parsed_bytes;
*last_id = id;
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure this is correct? If we parse the ID successfully, but not the value, don't we want to parse the ID again in the next run?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, and we will do, assuming there is sufficient data. But as it is, because we don't update last_id, the if (id == *last_id) check never succeeds and we get stuck in a loop until the watchdog kills the thread.

@martinjaeger martinjaeger merged commit dc5c398 into ThingSet:main Apr 10, 2024
1 check passed
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.

None yet

2 participants