You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue appears to be related to the usage of blockingGet, which can lead to nondeterministic behavior. Using blockingGet is generally not recommended, as it can introduce race conditions or unpredictable behavior in asynchronous operations.
Platform on which you observed the bug:
Device on which you observed the bug:
Describe the bug
When calling doFactoryReset, it sometimes fails to complete without any error being reported. After conducting some investigation and adding more logging, I identified that the execution halts at the following line in the BDBleApiImpl.kt file:
https://github.com/polarofficial/polar-ble-sdk/blob/master/sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/impl/BDBleApiImpl.kt#L2053.
The issue appears to be related to the usage of blockingGet, which can lead to nondeterministic behavior. Using blockingGet is generally not recommended, as it can introduce race conditions or unpredictable behavior in asynchronous operations.
Proposed Fix:
The use of blockingGet is unnecessary in this case, as we can save the backupFiles earlier at this line:
https://github.com/polarofficial/polar-ble-sdk/blob/master/sources/Android/android-communications/library/src/sdk/java/com/polar/sdk/impl/BDBleApiImpl.kt#L1963. This would align the Android implementation with the iOS implementation and eliminate the need for blocking calls.
Outcome:
After applying the fix by saving the backup files earlier, I was no longer able to reproduce the issue, and the doFactoryReset completed successfully.
The text was updated successfully, but these errors were encountered: