Skip to content

Poll content status before embedding the block-editor Preview panel player - #618

Merged
galbus merged 2 commits into
mainfrom
claude/beyondwords-preview-render-bug-f8f654
Aug 11, 2026
Merged

Poll content status before embedding the block-editor Preview panel player#618
galbus merged 2 commits into
mainfrom
claude/beyondwords-preview-render-bug-f8f654

Conversation

@galbus

@galbus galbus commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The block-editor Preview panel skipped its "wait until processed" poll for any content ID that was already on the post when the editor mounted — it only polled a content ID that appeared later in the same browser session. Opening the editor on a just-published post whose audio was still processing embedded the player immediately, 404ing (and letting the CDN cache that 404). The classic editor never had this shortcut, which is why only the block editor showed the bug.
  • Voice customisation makes this far more likely to hit: a non-default voice/model can take noticeably longer to process than the project default, widening the window where a post is still processing when the editor is opened — matching reports of the Preview panel failing to render for a voice-customised post despite the content eventually generating fine and playing on the frontend.
  • src/editor/components/play-audio/hooks.js now always confirms processed before embedding, mirroring the classic editor.
  • Added two Cypress tests to preview-panel.cy.js covering a voice-customised post: one confirms the panel shows "Generating…" and never calls the player SDK while status is processing, the other confirms it embeds once status is processed. Both stub the player SDK script for determinism (the poll path was previously left uncovered here due to real-CDN flakiness).

Test plan

  • npm run lint:js / wp-scripts format --check on the changed files
  • npm run test:unit (Jest) — all suites pass, unaffected
  • Ran the new spec live against a local wp-env: npx cypress run --spec 'tests/cypress/e2e/block-editor/preview-panel.cy.js' — all 3 tests pass
  • Verified regression coverage: reverted hooks.js to the pre-fix version and reran the same spec — the new "still processing" test correctly fails (cy.wait for the status check times out, since the old code never checks status before embedding)

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@galbus
galbus requested a review from nklhtv August 11, 2026 13:49
@galbus
galbus merged commit 15f4418 into main Aug 11, 2026
8 of 10 checks passed
@galbus
galbus deleted the claude/beyondwords-preview-render-bug-f8f654 branch August 11, 2026 13:51
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.

2 participants