Skip to content

fix: await initializeStores() before mounting Vue#165

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/init-stores-before-mount
May 10, 2026
Merged

fix: await initializeStores() before mounting Vue#165
rubenvdlinde merged 1 commit into
developmentfrom
fix/init-stores-before-mount

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

App.vue's async await initializeStores() in created() raced with child components: Vue mounts children before async created() hooks resolve, so LiveMeeting.created() called fetchObject('meeting', ...) and subscribe(...) before registerObjectType('meeting', ...) had run. The lib correctly threw 'Object type meeting is not registered' and the page rendered with empty data.

Now awaiting in main.js before $mount('#content'). App.vue's call stays in place as documented-idempotent safety net.

Surfaced while running the canonical decidesk LiveMeeting two-browser e2e against live notify_push.

App.vue's `async created() { await initializeStores() }` was insufficient
to guarantee the lib's shared object store had its types registered
before child components run. Vue doesn't wait for an async `created()`
hook to resolve before mounting children — so a child like LiveMeeting
ran its own `created()` (which calls `fetchObject('meeting', this.id)`
and three `subscribe(...)` calls) BEFORE App.vue's awaited
`initializeStores()` had a chance to call `registerObjectType('meeting',
...)`. The lib correctly threw "Object type 'meeting' is not registered"
and the page rendered with empty `meeting = {}` + fallback header.

Awaiting `initializeStores()` in main.js before `$mount('#content')`
guarantees the store is hot by the time any child's `created()` fires.
The App.vue call stays in place — `initializeStores()` is documented
idempotent, and the second await harmlessly resolves immediately.

Surfaced while running the canonical decidesk LiveMeeting two-browser
demo against the live notify_push stack: browser-1 received the
authenticated WS frame for `or-object-{meetingUuid}` correctly, but
the page couldn't react because the store wasn't initialised.
@rubenvdlinde rubenvdlinde merged commit 3b99f05 into development May 10, 2026
9 of 14 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/decidesk @ ef43bbb

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-05-10 11:40 UTC

Download the full PDF report from the workflow artifacts.

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