Skip to content

fix: attach module event dispatcher during startup - #85

Open
localhost41 wants to merge 1 commit into
tetherto:mainfrom
localhost41:fix/eager-module-event-dispatcher
Open

fix: attach module event dispatcher during startup#85
localhost41 wants to merge 1 commit into
tetherto:mainfrom
localhost41:fix/eager-module-event-dispatcher

Conversation

@localhost41

Copy link
Copy Markdown

Summary

Attach the module-event dispatcher as soon as the HRPC instance is created, before workletStart can construct a module and emit an event. The existing listener fan-out already drops events cleanly when an application has no subscriber, so eager attachment closes the startup race without changing subscription behavior.

The dispatcher remains idempotent per HRPC instance, and the subscription path still calls the same helper as a fallback.

Validation

  • Added coverage that the dispatcher attaches once even without an application listener
  • Added an ordering assertion that attachment happens before workletStart
  • npm test -- --runInBand (481 tests)
  • npm run typecheck
  • npm run lint
  • npm run build
  • git diff --check

Closes #83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Any bundled module that emits an event before the app subscribes crashes the app — moduleEvent handler is registered lazily

1 participant