oppia / oppia-android

A free, online & offline learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
318 stars 520 forks source link

[BUG]: AnalyticsController.kt is neither sequential nor thread-safe #5364

Open masclot opened 7 months ago

masclot commented 7 months ago

Describe the bug

AnlyticsController is using a single-thread dispatcher (blocking dispatcher) to asynchronously log events. A single thread dispatcher, however, does not guarantee sequentiality nor atomicity when there are suspend methods involved.

Steps To Reproduce

Multithreading bug. Can lead to random errors.

Expected Behavior

Log calls should be handled sequentialy.

Screenshots/Videos

No response

What device/emulator are you using?

No response

Which Android version is your device/emulator running?

No response

Which version of the Oppia Android app are you using?

No response

Additional Context

No response

masclot commented 7 months ago

Could be related to #5063 #5064.