Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix sending RPC messages after connection #354

Merged
merged 3 commits into from
Oct 26, 2023
Merged

Conversation

gmaclennan
Copy link
Member

Trying to send an RPC message immediately after connecting the RPC
channel would fail because the protomux channel was not yet open. This
fix ensures that sending an RPC message waits for a peer to fully
connect before trying to send. This is necessary for sending device info
(e.g. the device name) immediately after connecting to a peer.

Trying to send an RPC message immediately after connecting the RPC
channel would fail because the protomux channel was not yet open. This
fix ensures that sending an RPC message waits for a peer to fully
connect before trying to send. This is necessary for sending device info
(e.g. the device name) immediately after connecting to a peer.
@gmaclennan gmaclennan self-assigned this Oct 25, 2023
Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the async coloring is strong in this PR 😄 are there any other tests that need to be updated as a result? would've expected some of the existing ones around rpc/invites needing it, but maybe not?

@gmaclennan
Copy link
Member Author

The only place this affects tests is throwing errors, which are thrown asynchronously now. However it happened that in the tests for the invite API we always returned the method result, so the tests check the async errors fine. The main changes were needed to make the invite API async now.

@gmaclennan gmaclennan merged commit 2ff2a99 into main Oct 26, 2023
7 checks passed
@gmaclennan gmaclennan deleted the fix/rpc-await-send branch October 26, 2023 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpc.sendDeviceInfo() fails if used immediately after connecting RPC channel
2 participants