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

provide callback for muxrpc.close #36

Merged
merged 1 commit into from
Feb 12, 2024
Merged

provide callback for muxrpc.close #36

merged 1 commit into from
Feb 12, 2024

Conversation

mixmix
Copy link
Member

@mixmix mixmix commented Dec 13, 2023

Problem: in nodejs mobile we were getting an app crash on using an invite:

      else if (err) throw clarify(err, 'no callback provided for muxrpc close')
                    ^

Error: no callback provided for muxrpc close
    at /data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:45138:27
    at /data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:15455:36
    at Array.forEach (<anonymous>)
    at PacketStream._maybedone (/data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:15455:18)
    at PacketStream.destroy (/data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:15439:8)
  Error: unexpected end of parent stream
    at PacketStream.destroy (/data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:15414:7)
    at PacketStream.write (/data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:15476:41)
    at /data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:108957:17
    at /data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:120201:24
    at /data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:193644:11
    at pscDecodeRead (/data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:136990:25)
    at next (/data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:193641:9)
    at /data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:193643:41
    at Object.pscDecodeHead [as cb] (/data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:136998:18)
    at drain (/data/user/0/io.ahau.whakapapa/files/www/nodejs-project/index.js:130769:14)

Tracked this down into muxrpc and I think what's happening is a race condition around ps and ws closing. We were only seeing this crash when Ben (in Colombia) was trying to use an invite to my pub in New Zealand 😢 (no such problems in NZ peer -> NZ pub)

ANYWAY the throw is happening because there is no cb being provided on close. So I've provided a callback ...

@mixmix mixmix requested a review from Powersource January 7, 2024 06:57
@mixmix mixmix merged commit ab7935c into master Feb 12, 2024
5 checks passed
@mixmix mixmix deleted the close_error branch February 12, 2024 06:46
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.

2 participants