urbanairship / airship-mobile-framework-proxy

Apache License 2.0
0 stars 3 forks source link

Android EventEmitter wrong condition for takePending #43

Closed FrenkyBojler closed 3 months ago

FrenkyBojler commented 5 months ago

Hello guys, I noticed event listeners started to behave wrong on Android and found a flawed code for getting pending events.

In PR #39 there is a commit containing this change in file android/airship-framework-proxy/src/main/java/com/urbanairship/android/framework/proxy/events/EventEmitter.kt

image

The code doesn't work as expected, it removes and returns ALL of the pending events (ignoring the given types).

The code snippet should look like this: pendingEvents.removeAll { types.contains(it.type) && result.add(it) }

You can check a demonstration here in Kotlin Playground: https://pl.kotl.in/Ae27Yxg4a

Cheers

rlepinski commented 3 months ago

This was fixed in 6.3.0 of this lib