Skip to content

Make EventBus.emit() synchronous to match actual usage#26

Merged
thedhanawada merged 1 commit intomasterfrom
fix/eventbus-sync-emit
Feb 19, 2026
Merged

Make EventBus.emit() synchronous to match actual usage#26
thedhanawada merged 1 commit intomasterfrom
fix/eventbus-sync-emit

Conversation

@thedhanawada
Copy link
Copy Markdown
Contributor

Summary

  • `emit()` was declared `async` and returned `Promise.all()`, but every call site treated it as synchronous (no `await`, no `.then()`)
  • This caused a misleading API contract and silently swallowed async handler errors
  • Removed the `async` keyword, Promise collection, and `Promise.all` return
  • Handlers are now invoked synchronously with errors caught and logged

Test plan

  • Verify all event bus emissions still work (navigation, view change, event CRUD)
  • Verify error handling in handlers still logs to console
  • Run `npm test`

emit() was declared async and returned Promise.all(), but every single
call site treated it as synchronous (no await, no .then()). This caused
a misleading API contract and silently swallowed async handler errors.

A UI event bus has no reason to be async. Removed the async keyword,
Promise collection, and Promise.all return. Handlers are now invoked
synchronously with errors caught and logged.
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
force-calendar-interface Ready Ready Preview, Comment Feb 19, 2026 9:37am

@thedhanawada thedhanawada merged commit c6ef738 into master Feb 19, 2026
11 of 13 checks passed
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.

1 participant