Skip to content

Conversation

eamodio
Copy link
Contributor

@eamodio eamodio commented Jun 1, 2025

Refs #192055

The "Element with id is already registered" message has long plagued many extensions, and I've tried to work around it the best I can in the extensions themselves, but while I've been able to get very close (employing a very similar fix) I haven't been able to avoid the race condition when calling reveal.

With these changes, I haven't been able to repo the race condition anymore, not through normal loading nor with reveal calls.

Hopefully this can land 🙏 @alexr00

@eamodio eamodio force-pushed the debt/view-id-already-registered branch from 749e699 to 5c22100 Compare June 20, 2025 23:18
private _loadingPromise: Promise<any> | undefined;
private trackAsLoading<T>(promise: Promise<T>): Promise<T> {
const chainedPromise = this._loadingPromise ? this._loadingPromise.finally(() => promise) : promise;
const last = chainedPromise.catch(() => { }).finally(() => {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we want to catch and ignore exception here. Can this be done without the catch?

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