Skip to content

[diffs] tolerate stale IntersectionObserver entries after disconnect#697

Merged
necolas merged 1 commit into
beta-1.2from
nicolas/virtualizer-no-throw
May 18, 2026
Merged

[diffs] tolerate stale IntersectionObserver entries after disconnect#697
necolas merged 1 commit into
beta-1.2from
nicolas/virtualizer-no-throw

Conversation

@necolas
Copy link
Copy Markdown
Contributor

@necolas necolas commented May 18, 2026

IntersectionObserver delivers entries asynchronously, so the callback can fire for a target the Virtualizer has already released via disconnect() or releaseElement() — at which point the target is no longer in this.observers and the previous code threw.

Replace the throw with continue so stale entries are ignored. The target-not-HTMLElement throw above is left as-is since real browsers won't deliver non-Element targets.

IntersectionObserver delivers entries asynchronously, so the callback can
fire for a target the Virtualizer has already released via disconnect() or
releaseElement() — at which point the target is no longer in
this.observers and the previous code threw.

Replace the throw with continue so stale entries are ignored. The
target-not-HTMLElement throw above is left as-is since real browsers
won't deliver non-Element targets.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

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

Project Deployment Actions Updated (UTC)
pierre-docs-diffshub Ready Ready Preview May 18, 2026 7:53pm
pierre-docs-trees Ready Ready Preview May 18, 2026 7:53pm
pierrejs-diff-demo Ready Ready Preview May 18, 2026 7:53pm
pierrejs-docs Ready Ready Preview May 18, 2026 7:53pm

Request Review

@necolas necolas merged commit 9be368a into beta-1.2 May 18, 2026
12 checks passed
@necolas necolas deleted the nicolas/virtualizer-no-throw branch May 18, 2026 22:31
amadeus pushed a commit that referenced this pull request May 20, 2026
…697)

IntersectionObserver delivers entries asynchronously, so the callback can
fire for a target the Virtualizer has already released via disconnect() or
releaseElement() — at which point the target is no longer in
this.observers and the previous code threw.

Replace the throw with continue so stale entries are ignored. The
target-not-HTMLElement throw above is left as-is since real browsers
won't deliver non-Element targets.
amadeus pushed a commit that referenced this pull request May 20, 2026
…697)

IntersectionObserver delivers entries asynchronously, so the callback can
fire for a target the Virtualizer has already released via disconnect() or
releaseElement() — at which point the target is no longer in
this.observers and the previous code threw.

Replace the throw with continue so stale entries are ignored. The
target-not-HTMLElement throw above is left as-is since real browsers
won't deliver non-Element targets.
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.

2 participants