Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes autorun logging bug. #197641

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/vs/base/common/observableInternal/autorun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,18 @@ export class AutorunObserver<TChangeSummary = any> implements IObserver, IReader

this.state = AutorunState.upToDate;

const isDisposed = this.disposed;
try {
if (!this.disposed) {
if (!isDisposed) {
getLogger()?.handleAutorunTriggered(this);
const changeSummary = this.changeSummary!;
this.changeSummary = this.createChangeSummary?.();
this._runFn(this, changeSummary);
}
} finally {
getLogger()?.handleAutorunFinished(this);
if (!isDisposed) {
getLogger()?.handleAutorunFinished(this);
}
// We don't want our observed observables to think that they are (not even temporarily) not being observed.
// Thus, we only unsubscribe from observables that are definitely not read anymore.
for (const o of this.dependenciesToBeRemoved) {
Expand Down