fix: correct receiveFrom call signature in Parent constructor#101
Open
blahah wants to merge 1 commit intoholepunchto:mainfrom
Open
fix: correct receiveFrom call signature in Parent constructor#101blahah wants to merge 1 commit intoholepunchto:mainfrom
blahah wants to merge 1 commit intoholepunchto:mainfrom
Conversation
The Parent class constructor was passing two arguments to receiveFrom():
ipc.receiveFrom(id, (...args) => { ... })
But receiveFrom() only accepts one argument (the listener function).
This caused the id to be treated as the listener, which then threw:
TypeError: The "listener" argument must be of type function
This fix aligns with how GuiCtrl#rxtx() correctly calls receiveFrom():
ipc.receiveFrom((...args) => this.emit('message', ...args))
Fixes holepunchto#98
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.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.
Summary
Fix
ui.app.parentthrowingTypeError: The "listener" argument must be of type functionwhen accessed from within aui.View.Problem
The
Parentclass constructor was passing two arguments toreceiveFrom():But
receiveFrom()only accepts one argument (the listener function), soidwas being treated as the listener, causing:Solution
Remove the erroneous
idargument to align with howGuiCtrl#rxtx()correctly callsreceiveFrom():Test plan
ui.app.parentno longer throws when accessed from aui.ViewFixes #98
🤖 Generated with Claude Code