Skip to content

Commit 39763bf

Browse files
use correct abort controller ref for initial settings
1 parent 2dfe778 commit 39763bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/common/src/client/watched/processors/AbstractQueryProcessor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ export abstract class AbstractQueryProcessor<
156156
*/
157157
protected async init() {
158158
const { db } = this.options;
159+
// Make a ref copy of this early since it might be updated by updateSettings while this
160+
// method is running
161+
const { abortController } = this;
159162

160163
const disposeCloseListener = db.registerListener({
161164
closing: async () => {
@@ -180,13 +183,12 @@ export abstract class AbstractQueryProcessor<
180183

181184
// Initial setup
182185
await this.runWithReporting(async () => {
183-
await this.updateSettingsInternal(this.options.watchOptions, this.abortController.signal);
186+
await this.updateSettingsInternal(this.options.watchOptions, abortController.signal);
184187
});
185188
}
186189

187190
async close() {
188191
this._closed = true;
189-
await this.initialized;
190192
this.abortController.abort();
191193
this.disposeListeners?.();
192194
this.disposeListeners = null;

0 commit comments

Comments
 (0)