StoreFacade subscriptions remove their own entries during iteration, and because deletion in the Roku array shifts all entries after this operation it could mess up invoking order or even call a crash.
How did you implement it:
This fix simply changes subscriptions from array to map (AssociativeArray), so the order won't matter.
Also, it checks if a listener is for sure valid before invoking a callback.
How can we verify it:
The behavior won't change, but if it was causing issues, all should be resolved.
Todos:
[x] Fix linting errors
[x] Enable "Allow edits from maintainers" for this PR
[X] Update the messages below
Is this ready for review?: YES
Is it a breaking change?: NO
What did you implement:
StoreFacade subscriptions remove their own entries during iteration, and because deletion in the Roku array shifts all entries after this operation it could mess up invoking order or even call a crash.
How did you implement it:
This fix simply changes subscriptions from array to map (AssociativeArray), so the order won't matter. Also, it checks if a listener is for sure valid before invoking a callback.
How can we verify it:
The behavior won't change, but if it was causing issues, all should be resolved.
Todos:
Is this ready for review?: YES Is it a breaking change?: NO