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

Issue handling the message from the browser #4

Open
ElModdy opened this issue Mar 27, 2019 · 1 comment
Open

Issue handling the message from the browser #4

ElModdy opened this issue Mar 27, 2019 · 1 comment

Comments

@ElModdy
Copy link

ElModdy commented Mar 27, 2019

Hi, sorry for my english.
Sometimes the module can handle the request like so:
normal
other times it splits the message in two parts and can't pass your if statement like so:
issue.
PS. This happens in the same process with the same postMessage the only thing that change is the time 😄.

@pyrho
Copy link

pyrho commented Feb 18, 2020

I had the same issue (with firefox), the issue is that sometimes (not sure if this is firefox specific or not) Firefox will send only the size of the payload, and in its next batch of stdout spamming will send the actual payload.

So if you try to read the size off stdout each time the readable event is emitted, you'll read a garbage size.

I created a simple library which addresses the issue, I know I should have submitted a PR here instead but this issue was more than a year old with no activity so I didn't :(

Someone can easily "steal" the code from there to patch this.

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

2 participants