getndazn / kopytko-framework

A modern Roku's Brightscript framework based on JS world's solutions
MIT License
19 stars 6 forks source link

fix: subscriptions remove own entries during iteration #36

Closed bchelkowski closed 1 year ago

bchelkowski commented 1 year ago

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

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.3.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: