chr15m / bugout

Back end web app services over WebRTC.
https://chr15m.github.io/bugout
MIT License
604 stars 59 forks source link

Error ".toString() of undefined" inside .rpc() #25

Closed robot45dev closed 3 years ago

robot45dev commented 4 years ago

Hey. Your project is amazing. But I ran into a problem: it turns out that you can’t call callback() inside .register() if this happens inside .then() or even setTimeout(). I get the error ".toString() of undefined". I suppose there are reasons for this behavior, but it seems to me that the benefit of synchronous callback() is not much, since you cannot answer .rpc() after fetch() or a query to the database.

chr15m commented 4 years ago

@robot45dev thanks for reporting this. Can you provide a short piece of code to replicate the error you're seeing?

robot45dev commented 4 years ago

bugout.zip

I added setTimeout () to your sample code from the documentation. Repeatability 100%.

chr15m commented 3 years ago

@robot45dev thank you for your patience. I have reviewed and merged the fix from @woodgern, and published 0.0.10 on npm. If you get a chance to run your use-case again please re-open this if you still have issues.