fix: deliver poller events with MakeCallback - #239
Open
Azq2 wants to merge 1 commit into
Open
Conversation
Contributor
|
@reconbot might this be the fix for serialport/node-serialport#3148 (or at least part of it)? Source appears to be nodejs/node#62969 CC: @AlCalzone @Koenkk |
Contributor
Author
|
I can confirm that this fixes the issue for me. |
Woodii1998
added a commit
to zhouxiyu1997/friendmaker
that referenced
this pull request
Aug 19, 2026
* fix(serial): parse ACKs mixed with ESP-IDF logs and unblock Linux reads - strip ANSI color codes and recognize ESP-IDF log lines (e.g. 'W (4652) BT_HCI: ...') so ACKs polluted by device logs parse correctly instead of being treated as malformed and triggering retry/reset - when an ACK line is mixed with an embedded device log line, re-parse the ACK portion before dropping the line so the ACK is never lost - patch @serialport/bindings-cpp unix-read with a 50ms poller fallback: on Linux the poller readable event can be missed (shared uv_poll, overriding registration), leaving serial data stranded in the fd for 2-6s until the next device output arrives; the fallback re-tries fs.read so data is always read within 50ms Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(serial): align poller patch with upstream MakeCallback fix - apply serialport/bindings-cpp#239 to deliver poller callbacks immediately - keep the patch-package override on the native poller source - strip complete common ANSI escape sequences before ACK parsing - preserve ESP-IDF log recognition and mixed-line ACK recovery Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(serial): recover ACKs glued after device logs and dedupe ACK handling Recognizing ESP-IDF log lines made sanitizeDeviceLine keep mixed log-before-ACK lines intact, which skipped the old tail-ACK fallback and dropped those ACKs as plain device logs. Extract a trailing sequenced ACK from device log lines in waitForAck, forward the leading log segment, and route both mixed-line paths through a shared handleSequencedAck helper. Cover the line sanitizing and mixed-line ACK recovery with unit tests. Co-authored-by: Woodii <Woodii1998@users.noreply.github.com> * chore: minimize package-lock diff to patch-package additions Rebase the lockfile on main and merge in only the patch-package dependency closure, dropping the unrelated peer/optional flag churn introduced by regenerating the whole lockfile with a different npm version. Co-authored-by: Woodii <Woodii1998@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Woodii <Woodii1998@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix native poller callbacks to use
MakeCallback, so promise continuations scheduled by readable events run immediately instead of waiting for a later event-loop tick.Example of bug:
I saw this problem when EAGAIN happens.