Skip to content

fix(widget): replay cached messages without MessageEvent#7440

Open
shoom3301 wants to merge 5 commits into
mainfrom
fix/widget-events-cache
Open

fix(widget): replay cached messages without MessageEvent#7440
shoom3301 wants to merge 5 commits into
mainfrom
fix/widget-events-cache

Conversation

@shoom3301
Copy link
Copy Markdown
Collaborator

@shoom3301 shoom3301 commented Apr 30, 2026

Summary

Fixes #7428

It turned out that some browsers (Firefox) do not support creating MessageEvent with source:

MessageEvent constructor: 'source' member of MessageEventInit could not be converted to any of: WindowProxy, MessagePort, ServiceWorker.

Because of that I changed the messages caching mechanism and do a direct handler call isntead of replaying the events on window.

image

To Test

  1. Widget should not crash in Firefox
  2. Changing parameters in the Widget configurator should have a corresponding impact on the widget

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

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

Project Deployment Actions Updated (UTC)
cowfi Ready Ready Preview May 12, 2026 0:34am
explorer-dev Ready Ready Preview May 12, 2026 0:34am
storybook Error Error May 12, 2026 0:34am
swap-dev Ready Ready Preview May 12, 2026 0:34am
widget-configurator Ready Ready Preview May 12, 2026 0:34am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
cosmos Ignored Ignored May 12, 2026 0:34am
sdk-tools Ignored Ignored Preview May 12, 2026 0:34am

Request Review

@shoom3301 shoom3301 self-assigned this Apr 30, 2026
@shoom3301 shoom3301 added the RELEASE Included in the release that is being closed label Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e8f1e3b8-9622-455f-a669-7fa89544971b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/widget-events-cache

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 30, 2026

Deploying swap-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: c2d4c20
Status:🚫  Build failed.

View logs


if (!method) {
return
if (event.origin !== trustedOrigin) return
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important! Since we bypass IframeTransport for the cached messages, we validate the event here as well.

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

Labels

RELEASE Included in the release that is being closed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant