Repository navigation
fix(host): satisfy dsh 0.2.1 mandatory Peer (assertPeerLive / prepareInvocation) - #135
Open
qihaonanren wants to merge 1 commit into
Open
qihaonanren wants to merge 1 commit into
qihaonanren wants to merge 1 commit into
Conversation
…Invocation) dsh 0.2.1 validates the Peer on both carriers: - openWireStream($events) calls assertPeerLive(peer) + requireInteractions(peer) - prepareInvocation reads request.peer The 0.1.7 fix passed `undefined` for peer, which now throws `Cannot read properties of undefined (reading '''signal''')` right after hello.ok (WS close 1011), and every gateway.invoke() fails the same way (so side-panel messaging is broken too). Provide a never-disposed owner Peer and inject it into invoke() once.
4 tasks done
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.
Fixes the 0.2.1 half of what #134 describes.
dsh 0.2.1validates the Peer on both carriers, so passingundefined(the #102 remedy) is no longer enough:openWireStream($events)→assertPeerLive(peer)readspeer.signal→Cannot read properties of undefined (reading 'signal')immediately afterhello.ok(WS 1011).prepareInvocationreadsrequest.peer, so everygateway.invoke()throws the same way — that is also why side-panel messaging fails. This is an object property, not a positional argument, so an arity probe cannot detect it.Change
HOST_PEER(signal+principal.kind='owner'+interactions='answer')wireStream.openinstead ofundefinedcreateRemoteHostApisoinvoke()injects the peer once (Object.createkeeps the prototype chain — spreading would dropTypertGatewayServicemethods)Verified
On dsh 0.2.1-rc.3 + 0.0.7: before the patch the bridge closed 1011 within milliseconds of
hello.ok; after it the connection stays open (30s+ observed) andbrowser_snapshot/browser_click/browser_typeplus side-panel messaging all work.Kept 0.2.0-compatible: the peer is only read when the host validates it.