espressif / esp-idf-provisioning-ios

Apache License 2.0
134 stars 64 forks source link

Fix re-sending config data #49

Open cookie777 opened 2 years ago

cookie777 commented 2 years ago

Issue

The current ble connection freezes if you try to connect (establish the session) to the device again.

Details

Reason

The DispatchSemaphore doesn't call signal() when it catches errors.

Details

Solution

Set transportToken.signal() in delegate functions didWriteValueFor and didUpdateValueFor when it catches error.

        guard error == nil else {
            transportToken.signal() // This is needed to release Semaphore
            currentRequestCompletionHandler?(nil, error)
            return
        }
CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

vikas-chandra-mnnit commented 2 years ago

Hi @cookie777, we have removed DispatchSemaphore in our latest version of SDK I.e. 2.0.15. However, if you think there is some scenario in which use of the Semaphore is essential then do let us know so that we can quickly revert our changes and merge your PR for the next build.

cookie777 commented 2 years ago

Hello @vikas-chandra-mnnit . I'm happy with removing DispatchSemaphore 👍 Thank you for your support!

puneet-arora15 commented 1 year ago

@cookie777 Did the issue get resolved for you with the latest SDK ? As I'm still seeing this issue in the app

cookie777 commented 1 year ago

I havn't faced this issue after all transportToken.signal() are removed from the code.