kin-android
kin-android copied to clipboard
Possible asynchronous bug in `NetworkOperationsHandlerImpl `.
operations
should be populated before schedule
.
This line
operations[id] = op
should be placed before:
ioScheduler.schedule
The only thing that avoids an asynchronous bug is the delay of the operation execution,
what is not a correct pattern for synchronized
data.
It's possible to have the operation executed before the operations[id] = op
write.
https://github.com/kinecosystem/kin-android/blob/07dd33807f505ab9cb04e910760875d367c0b43e/base/src/main/java/org/kin/sdk/base/tools/NetworkOperationsHandler.kt#L224
https://github.com/kinecosystem/kin-android/blob/07dd33807f505ab9cb04e910760875d367c0b43e/base/src/main/java/org/kin/sdk/base/tools/NetworkOperationsHandler.kt#L219
feel free to submit a pr with your proposed change along side appropriate unit tests