Conversation
There was a problem hiding this comment.
Same as in Flutter and RN.
To make it completely thread-safe, we should ensure all external calls happen
after releasing the lock. The abstract flow should look like this:
For setting the listener (flush):
- Lock -> Assign the listener -> Copy cache to a temp list -> Clear cache -> Unlock.
- Iterate over the temp list and invoke the listener.
For dispatching a new event:
- Lock -> Check if the listener exists.
- If YES: Grab the listener reference -> Unlock -> Invoke the listener.
- If NO: Add the event to cache -> Unlock.
There was a problem hiding this comment.
same as in the ExecutionStateDispatcher.kt
src/models/threat.ts
Outdated
There was a problem hiding this comment.
Since Automation is Android-only, remove this.Automation from the iOS array.
There was a problem hiding this comment.
If the plugin is destroyed but the application process remains alive, the singleton will continue to hold the old Context, causing a memory leak. Therefore, the handleOnDestroy method should be overridden to release the dispatcher listeners.
There was a problem hiding this comment.
onDestroy() is not guaranteed to be called in the Android activity lifecycle, so this is not the best place for such actions. However, yes I will add this

What's new
Describe the PR shortly
PR checklist
In-app checks:
README.mdis updated (if applicable)exampleapp is workingPre-release checks:
CHANGELOG.mdis updatedpackage.jsonversion is increasedreleaselabel is applied on PRTo be checked by maintainers:
sdkVersionproperty in logs is correctsdkPlatformproperty in logs is correctResolved issues
list of issues resolved by this PR