-
Notifications
You must be signed in to change notification settings - Fork 85
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
"Write timeout." race condition #419
Comments
Thank you for this issue. Unfortunately I cannot reproduce it. Are you using the Are you using the undocumented The plugin is implemented with a queue in the JavaScript layer, if you use |
It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot. Have a great day! |
@pwespi
|
* fix(android): fix concurrency issue in timeoutmap(#419) * fix(android): rename into TimeoutHandler, cleanup * fix(android): replace removeIf --------- Co-authored-by: Anders Hausding <[email protected]>
closed by #560 |
Describe the bug
In few cases the android plugin rejects with timeout even when the request is sent correctly.
This happens In my Opinion here:
bluetooth-le/android/src/main/java/com/capacitorjs/community/plugins/bluetoothle/Device.kt
Lines 477 to 484 in b3af2a2
Where we resolve before clearing the TimeoutMap.
If the javascript code sends a request right away, TimeoutMap[key] is overridden and we loose the reference, this cause the timeout to not be cleared since we lost the reference, and it's triggered later and rejects
I also think that this is a race condition, since the java sometimes cleared before the other request.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Not to reject if no error happens
Plugin version:
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: