Skip to content

fix: prevent duplicate tip nodes on re-entrant renderGettingStartedTipIfNeeded#302317

Merged
meganrogge merged 2 commits intomicrosoft:mainfrom
sathvikc:fix-duplicate-tips
Mar 17, 2026
Merged

fix: prevent duplicate tip nodes on re-entrant renderGettingStartedTipIfNeeded#302317
meganrogge merged 2 commits intomicrosoft:mainfrom
sathvikc:fix-duplicate-tips

Conversation

@sathvikc
Copy link
Copy Markdown
Contributor

Summary

  • Fix duplicate getting-started tip nodes in chat widget caused by re-entrant calls to renderGettingStartedTipIfNeeded
  • Move the _gettingStartedTipPart guard assignment before the DOM append so re-entrant calls see the guard and return early
  • Add dom.clearNode(tipContainer) before append as a defensive measure against stale nodes

Root Cause

When ChatTipContentPart is constructed, context-key changes can synchronously trigger another call to renderGettingStartedTipIfNeeded. The guard (this._gettingStartedTipPart.value) was set after tipContainer.appendChild(), so the re-entrant call would pass the guard check, create a second tip, and append it -producing the "multiple identical tips stacked" symptom.

Fix

Reorder the method so that:

  1. The guard (this._gettingStartedTipPart.value = store) is set before any DOM mutation
  2. dom.clearNode(tipContainer) clears any stale nodes before appending the new tip

IMG_4445

Copy link
Copy Markdown
Collaborator

@meganrogge meganrogge left a comment

Choose a reason for hiding this comment

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

Thanks! Saw one report of this, but wasn't able to repro.

@meganrogge meganrogge added this to the 1.113.0 milestone Mar 17, 2026
@meganrogge meganrogge enabled auto-merge (squash) March 17, 2026 15:13
@meganrogge meganrogge merged commit 1926766 into microsoft:main Mar 17, 2026
23 of 35 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.

4 participants