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

job on_stdout is not retrieving all data #634

Closed
msvechla opened this issue Dec 13, 2024 · 1 comment · Fixed by #635
Closed

job on_stdout is not retrieving all data #634

msvechla opened this issue Dec 13, 2024 · 1 comment · Fixed by #635

Comments

@msvechla
Copy link
Contributor

msvechla commented Dec 13, 2024

Hi and thanks for this awesome project!

I have been using the plenary.curl module recently, especially it's capability to stream http responses using the underlying plenary.job on_stdout mechanism.

While using it, I discovered a few weired edge-cases where the last chunks of streamed data is only available via job:result(), but not the on_stdout callback.

Looking at the tests I found two related test cases that are marked as pending, so it seems like this has been a known issue.

As this is unnecessarily complicating my usage of the plenary.curl streaming functionality, as I would have to use both on_stdout and then at the end compare what has not yet been processed from the job:result(), I would like to resolve this bug.

Please let me know if I have misunderstood anything or you have further thoughts.
I will open a PR with a potential solution.

Thanks a lot!

msvechla added a commit to msvechla/plenary.nvim that referenced this issue Dec 13, 2024
The current condition prematurely quits processing of data in on_output
in some edge-cases.

In these cases `job:result()` will have all data, but not everyting was
sent through the `on_output` pipes.

Closes nvim-lua#634
msvechla added a commit to msvechla/plenary.nvim that referenced this issue Dec 13, 2024
@maheshbansod
Copy link

Facing the same issue.

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 a pull request may close this issue.

2 participants