thaliproject / Thali_CordovaPlugin

Thali p2p plugin
MIT License
226 stars 44 forks source link

ThaliCore: synchronous functions declared as asynchronous #1899

Closed enricogior closed 7 years ago

enricogior commented 7 years ago

AdvertiserRelay.createVirtualSocket() and AdvertiserVirtualSocketBuilder.createVirtualSocket() are declared asynchronous given they require an escaping completion handler, but they are strictly synchronous.

AdvertiserVirtualSocketBuilder.createVirtualSocket() doesn't declare the completion handler as an input argument but AdvertiserVirtualSocketBuilder.init() does and then the completion handler is used by createVirtualSocket().

Not a bug per se, but a bad design that should be fixed.

enricogior commented 7 years ago

Fixed in https://github.com/thaliproject/thali-ios/commits/master-enrico-error-handling-tmp