[WIP] Fix critical bug in TinyLink engine callback processing#12
Closed
Copilot wants to merge 1 commit into
Closed
[WIP] Fix critical bug in TinyLink engine callback processing#12Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
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.
src/TinyLink.h: Inupdate(), don't set_hasNew = truewhen_onReceiveis set (callback mode), only set it in polling modesrc/TinyProtocol.htest/test_callback.cppwith a test that feeds two frames to a callback-mode TinyLink and asserts both are receivedtest/test_runner.cppto register the new callback testflush()Original prompt
Summary
Fix a critical bug that causes the TinyLink engine to stop processing incoming frames when a user registers a callback via TinyLink::onReceive(). Remove a leading BOM in src/TinyProtocol.h. Add a native unit test that verifies callback-mode processes multiple frames (test/test_callback.cpp). Update GitHub Actions CI to build and run native tests so the new test runs automatically. Add a short clarification to README.md explaining callback-mode behavior.
Why
Detailed changes to apply
Representative code to apply in that branch (exact semantics to implement):
"Callback style behavior (clarification)
Callback mode is fully automatic: when you register a handler with
link.onReceive(...), TinyLink will invoke your handler from insidelink.update()as frames arrive and will continue parsing subsequent frames automatically. You do not need to callflush()when using callback mode —flush()is only required for the polling pattern (available()/peek()/flush())."Testing and verification
Files to be changed/added
Notes for reviewers
Repository
petesramek/tiny-link
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Review and rework TinyLink project.
Assistant: I'll start by fetching the repository contents and key files from petesramek/tiny-link so I can review the code, README, tests, and the project's structure. I'll run a GitHub read query now.
Assistant: Direct answer / recommendation
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.