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 broken line buffers #773

Merged
merged 2 commits into from Jun 2, 2021
Merged

Conversation

qRoC
Copy link
Contributor

@qRoC qRoC commented Apr 13, 2021

Line buffer does not work on big strings.

@qRoC qRoC requested a review from a team as a code owner April 13, 2021 20:07
@luketomlinson
Copy link
Contributor

hey @qRoC, thanks for the PR! Do you have some sample output to demonstrate the issue that your changes would fix? I think it could be helpful to have a test to demonstrate the behavior. I was having trouble reproducing this behavior over in #749, so I'd be curious if you have a consistent scenario that breaks.

@qRoC
Copy link
Contributor Author

qRoC commented May 24, 2021

The chunk in data event contains either one line of output or a line with the size of the buffer.

So to reproduce this error, just print a string larger than the buffer size.

For example, buffer size is 10 bytes, so for output:

aaa
bbbbbbbbbbccccc
ddd

The data event is fired 4 times:

aaa
bbbbbbbbbb
ccccc
ddd

Real case: cargo build with json output.

I fixed this in qRoC/cargo-actions@fff2c76

@luketomlinson
Copy link
Contributor

hi @qRoC, thank you for your response. I did some more digging, and I think this is a good fix for #749. If we can add a test for this case I will feel confident approving this. If you don't want to take that on, I am happy to take a stab at my own implementation.

@thboop thboop requested a review from luketomlinson June 2, 2021 15:21
Copy link
Contributor

@luketomlinson luketomlinson left a comment

Choose a reason for hiding this comment

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

Thanks for this PR @qRoC! I'm going to go ahead and merge and add a test later.

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