Skip to content

search: cache index per locale and tighten iframe postMessage origin #1350

Open
avinxshKD wants to merge 2 commits into
processing:mainfrom
avinxshKD:fix/issue-1249-searchprovider-codeembed
Open

search: cache index per locale and tighten iframe postMessage origin #1350
avinxshKD wants to merge 2 commits into
processing:mainfrom
avinxshKD:fix/issue-1249-searchprovider-codeembed

Conversation

@avinxshKD
Copy link
Copy Markdown

This changes the search flow to fetch/build the index only when locale changes, reuse the same Fuse instance for typing with a small debounce, and abort stale fetches, and it also removes wildcard postMessage usage by using same-origin target/checks.
I’m sending this as a small perf/safety cleanup for #1249 since the p5.sound part looks outdated now, but the repeated search work and loose messaging behavior were still valid to fix.

Refs #1249

@avinxshKD
Copy link
Copy Markdown
Author

@ksen0 @doradocodes pls take a look, kept focused fixes as discussed (search fetch/index flow + postMessage origin hardening)

@doradocodes
Copy link
Copy Markdown
Contributor

@avinxshKD From my understanding, this PR includes 2 different fixes:

  1. Fixes the issue with SearchProvider that rebuilds even when locale hasn't changed
  2. The use of * in postMessage() for iframes

If that is the case, it's important that we have 2 different issues created and 2 separate PRs to fix them. This helps keep things organized for the repo. Please update the original issue #1249 to have an accurate title+description, and create a new issue if relevant. Then have 2 PRs for the each of those issues. Thanks!

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.

CodeEmbed/frame.tsx: p5.sound never loads in iframes + postMessage uses wildcard origin

2 participants