-
Notifications
You must be signed in to change notification settings - Fork 156
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
deleteStoredDeviceData does not wait for files to be deleted #498
Comments
We managed to tweak the |
Implemented the same thing for Android. |
Thank you for helping to solve this. The fix will be released in the next release. |
This should be fixed in the latest SDK release 5.10.0. |
Thank you, @samulimaa. I appreciate you taking the time to investigate this. If I understand correctly, the current implementation blocks the thread until deleteOpCompleted becomes true (see here). This flag is only set to true once all requested files have been deleted. While this approach may work in the ideal case, I have concerns about its behavior when errors occur. For example, if a file deletion fails due to a connection interruption, deleteOpCompleted would never be set to true, causing the while loop to run indefinitely. Given that the SDK relies heavily on the reactive paradigm through RxSwift and RxKotlin, I believe it would be beneficial to offer a solution that aligns with this pattern. While it may require more effort, such a solution would maintain consistency with the architecture and handle error cases more effectively. I am happy to assist with this, as I have already worked on similar improvements. cc @palmqvisti |
Platform on which you observed the bug:
Device on which you observed the bug:
Describe the bug
Looking at the implementation of deleteDataDirectories on Android it looks like the method does not wait for all the underlying operations to complete. Also, in case of any errors they won't be reported, because the metod always returns complete.
Expected behavior
deleteDataDirectories
method should complete after all files have been deleted, all errors should be reported to the caller that subscribes to it.The text was updated successfully, but these errors were encountered: