Repository navigation
fix: unblock Linux serial ACKs and harden mixed log parsing (PR #91 + review fixes) - #1
Closed
Woodii1998 wants to merge 4 commits into
Closed
Woodii1998 wants to merge 4 commits into
Woodii1998 wants to merge 4 commits into
Conversation
- 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>
- 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>
…ling 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>
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>
cursor
Bot
changed the base branch from
main
to
cursor/tmp-rebase-trigger-6fe8
August 19, 2026 07:19
cursor
Bot
changed the base branch from
cursor/tmp-rebase-trigger-6fe8
to
main
August 19, 2026 07:19
Woodii1998
marked this pull request as ready for review
August 19, 2026 07:20
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.
Summary
This branch carries PR #91 (by @Alxkcx) plus two review follow-up commits. It exists because the review bot cannot push to the contributor's fork; if the follow-up commits get applied to
Alxkcx:formal-serialdirectly, this PR can be closed in favor of zhouxiyu1997#91.What PR zhouxiyu1997#91 contains (unchanged, first two commits)
patch-packagepatch for@serialport/bindings-cpp@13.0.0aligning with upstream serialport/bindings-cpp#239 (callback.Call→callback.MakeCallback), fixing multi-second ACK delays on Linux.sender.tshardening: strip ANSI escapes, recognize ESP-IDF log lines, and recover ACKs when a log is glued after the ACK on the same UART line.Review fixes added on top (last two commits)
sanitizeDeviceLinekeep mixed lines likeW (4652) BT_HCI: ...recvOK <sid> <seq>intact, which skipped the old tail-ACK fallback — the ACK was forwarded as a plain device log and the command timed out.waitForAcknow extracts a trailing sequenced ACK from device log lines and forwards the leading log segment.handleSequencedAckhelper.apps/desktop/test/serial-line-parsing.test.ts, 14 cases): ANSI stripping, ESP-IDF log recognition, embedded-log extraction, and end-to-endwaitForAckbehavior for OK/ERR ACKs mixed with logs (log-before and log-after), ignored out-of-sequence ACKs, and malformed-ACK rejection.package-lock.jsononmainand merged in only thepatch-packagedependency closure, dropping the unrelatedpeer/optionalflag churn from regenerating the whole lockfile with a different npm version. The diff is now purely additive (+351 lines).Verification
npm cifrom scratch: patch applies,@electron/rebuildcompilesbindings-cppfrom the patched source, and the runtime loadsbuild/Release/bindings.node(verified by hash against the shipped prebuilds).tsc --noEmitpasses.