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

Add warning that StreamParser prefix and comment events are not synchronized to data #440

Open
RubenVerborgh opened this issue Sep 6, 2024 · 0 comments

Comments

@RubenVerborgh
Copy link
Member

RubenVerborgh commented Sep 6, 2024

#423 introduced the comment event on StreamParser. In #439, I realized that comment emitted by StreamParser is not guaranteed to be synchronized. That is, there is no guarantee that an event timeline of "data" "comment" "data" means that the comment in question was actually positioned in between the two quads in the source file.

Similarly, the prefix event is also not reliable.

This is inherently unfixable with ReadStream<Quad> (only fixable with ReadStream<Quad|Prefix|Comment>), so we should document this. Consumers MUST NOT rely on synchronization, because there is none.

This is less harmful for usage of prefix and comment for non-location-specific information purposes (as would nearly always be the case for prefixes). If any prefix or comment handling pertains to a specific position, StreamParser usage must be replaced by Parser, which does provide order guarantees.

@RubenVerborgh RubenVerborgh changed the title Add warning that StreamParser prexied and comment events are not synchronized to data Add warning that StreamParser prefix and comment events are not synchronized to data Sep 6, 2024
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

No branches or pull requests

1 participant