Skip to content

SCAL-352370: show a notice for unresolved replays, harden the frame guard and stop MCP frame renderer re-processing its own fallback iframe - #748

Merged
adityamittal3107 merged 8 commits into
mainfrom
SCAL-352370
Nov 16, 2026
Merged

adityamittal3107 merged 8 commits into
mainfrom
SCAL-352370

Conversation

@mouryabalabhadra

Copy link
Copy Markdown
Collaborator

Review follow-ups to the reload-loop fix:

  • A stored-chat frame whose answer cannot be resolved is now replaced with a short text notice. Its source URL carries no session params, so rendering it loaded the ThoughtSpot homepage outside embed mode and triggered an IdP login redirect inside the iframe.
  • Strip the SDK markers once, from the parsed source URL, instead of through a helper that handled two param types.
  • Record iframes nested inside an inserted node, so the observer's subtree scan cannot re-process them either.
  • Restore the base-class bookkeeping (insertedDomEl, embed-node tag) that the in-place replacement skipped.

When replay resolution failed (e.g. 422 "Invalid org id"), the fallback returned the source URL unchanged, leaving tsmcp=true on the inserted iframe. The MutationObserver re-detected it and replaced it endlessly.

Always strip the SDK markers from the fallback URL, and skip iframes the renderer inserted itself. Tests pin both behaviours.

…uard

Review follow-ups to the reload-loop fix:

- A stored-chat frame whose answer cannot be resolved is now replaced
  with a short text notice. Its source URL carries no session params, so
  rendering it loaded the ThoughtSpot homepage outside embed mode and
  triggered an IdP login redirect inside the iframe.
- Strip the SDK markers once, from the parsed source URL, instead of
  through a helper that handled two param types.
- Record iframes nested inside an inserted node, so the observer's
  subtree scan cannot re-process them either.
- Restore the base-class bookkeeping (insertedDomEl, embed-node tag)
  that the in-place replacement skipped.

SCAL-352370: stop MCP frame renderer re-processing its own fallback iframe

When replay resolution failed (e.g. 422 "Invalid org id"), the fallback
returned the source URL unchanged, leaving tsmcp=true on the inserted
iframe. The MutationObserver re-detected it and replaced it endlessly.

Always strip the SDK markers from the fallback URL, and skip iframes the
renderer inserted itself. Tests pin both behaviours.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the AutoFrameRenderer to handle cases where a stored-chat frame's answer cannot be resolved by replacing the frame with a text notice instead of falling back to a bare source URL. It also introduces a renderedFrames WeakSet to track inserted nodes and nested iframes, preventing infinite loops or re-processing, and adds comprehensive unit tests to verify these behaviors. The reviewer suggests making the unresolved answer notice string configurable via AutoMCPFrameRendererViewConfig to support internationalization and customization.

Comment thread src/embed/auto-frame-renderer.ts Resolved
Add unresolvedAnswerNoticeText to AutoMCPFrameRendererViewConfig,
mirroring staleAnswerNoticeText, so host apps can translate or reword
the notice shown when a stored-chat answer cannot be loaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGcppFDEehwHW97pRagB2h
@pkg-pr-new

pkg-pr-new Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@thoughtspot/visual-embed-sdk@748

commit: 9b6ea0e

claude and others added 2 commits November 13, 2026 17:55
…6.10.0.cl

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGcppFDEehwHW97pRagB2h
A host app's chat can span several analytical sessions: a session
belongs to the Org it was created in, so after an Org switch new answers
come from a new session. Say that tsmcpConversationId is set per answer
to the session that produced it, that tsmcpAnswerIndex counts within
that session (and falls back to 0 when malformed or negative), and that
an answer from another Org cannot be resolved - pointing at
unresolvedAnswerNoticeText, which carries its own version.

Also fix a stale @returns: a failed resolve now shows the notice rather
than falling back to the source URL.

Regenerate static/typedoc/typedoc.json with npm run docgen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mouryabalabhadra and others added 2 commits November 14, 2026 00:26
Patch bump. Resolves the @Version SDK: <TBD> placeholders to 1.54.1
(npm run resolve-versions) and regenerates static/typedoc/typedoc.json
(npm run docgen), the same steps as the bump-version workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…6.9.0.cl

Regenerate static/typedoc/typedoc.json with npm run docgen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mouryabalabhadra
mouryabalabhadra marked this pull request as ready for review November 14, 2026 08:33
@mouryabalabhadra
mouryabalabhadra requested a review from a team as a code owner November 14, 2026 08:33
mouryabalabhadra and others added 2 commits November 14, 2026 00:37
Keep the version at 1.54.0 and the new @Version tags at SDK: <TBD>; the
release bump fills them in. Keeps unresolvedAnswerNoticeText targeted
at ThoughtSpot Cloud 26.9.0.cl. Regenerate static/typedoc/typedoc.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
static/typedoc/typedoc.json is generated at release time; restore it to
the base branch's version so this PR carries no generated output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adityamittal3107
adityamittal3107 merged commit 11296e7 into main Nov 16, 2026
10 checks passed
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.

3 participants