Skip to content

Don't feed the placeholder dapp URL to the marketplace iframe - #3630

Merged
tom2drum merged 1 commit into
mainfrom
claude/frontend-bug-3581-b674fa
Aug 11, 2026
Merged

Don't feed the placeholder dapp URL to the marketplace iframe#3630
tom2drum merged 1 commit into
mainfrom
claude/frontend-bug-3581-b674fa

Conversation

@tom2drum

Copy link
Copy Markdown
Collaborator

Closes #3581

Problem

useAppQuery serves a stub app (src/features/marketplace/stubs.ts) as placeholderData while the real dapp loads. That stub's url is https://example.com, and the dapp page passed it straight into the iframe src — so the browser actually fetched example.com and flashed it before the real dapp URL arrived.

The stub URL caused a second, quieter bug: getAppUrl validates a user-supplied ?url= param by comparing its origin against the app's. Against the stub, a legitimate ?url= was treated as a foreign origin and silently stripped from the router.

Changes

  • MarketplaceApp.tsx — pass undefined to getAppUrl while isPlaceholderData is true, so no URL is derived from stub data.
  • MarketplaceAppIframe.tsx — keep the iframe unmounted and the ContentLoader visible until a real appUrl exists. This also covers the essential-dapp page (Swap.tsx), where appUrl comes from config and can legitimately be undefined.

Notes for the reviewer

  • The stub is still used for the top bar skeletons; only the iframe stops consuming it.
  • Verified with a temporary Playwright test that delayed the dapp API response and asserted example.com was never requested — it passed with this change. The test is not included in this branch; happy to add it if you'd like a permanent regression guard.
  • Playwright can't be run from an agent worktree: playwright-ct.config.ts sets testIgnore: '.claude/worktrees/**', so a run inside one finds 0 tests. I worked around it with a throwaway config override.

🤖 Generated with Claude Code

`useAppQuery` serves a stub app as `placeholderData` while the real dapp
is loading. Its `url` is `https://example.com`, which the dapp page passed
straight into the iframe `src` — so the browser really fetched example.com
and flashed it before the actual dapp URL arrived.

The stub URL also broke `getAppUrl`: a legitimate `?url=` param was compared
against the stub's origin and silently dropped as foreign.

Skip the URL entirely while the query holds placeholder data, and keep the
iframe unmounted (loader visible) until a real URL is available. The latter
also covers the essential-dapp page, where the URL comes from config and can
be undefined.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tom2drum tom2drum added the bug Something isn't working label Aug 11, 2026
@tom2drum
tom2drum merged commit b5777b9 into main Aug 11, 2026
12 checks passed
@tom2drum
tom2drum deleted the claude/frontend-bug-3581-b674fa branch August 11, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix dapp detail iframe flashing placeholder example.com on load

1 participant