Skip to content

Commit a45f72a

Browse files
committed
Fix tests
1 parent 2418c5c commit a45f72a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/web/src/db/adapters/LockedAsyncDatabaseAdapter.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ export class LockedAsyncDatabaseAdapter
203203
);
204204
}
205205

206-
static dbLockRequestId = 0;
207-
208206
protected async acquireLock(callback: () => Promise<any>, options?: { timeoutMs?: number }): Promise<any> {
209207
await this.waitForInitialized();
210208

@@ -223,7 +221,6 @@ export class LockedAsyncDatabaseAdapter
223221
}, timeoutMs)
224222
: null;
225223

226-
const id = LockedAsyncDatabaseAdapter.dbLockRequestId++;
227224
return getNavigatorLocks().request(`db-lock-${this._dbIdentifier}`, { signal: abortController.signal }, () => {
228225
this.pendingAbortControllers.delete(abortController);
229226
if (timoutId) {

packages/web/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,12 @@ export class WorkerWrappedAsyncDatabaseConnection<Config extends ResolvedWebSQLO
149149
async close(): Promise<void> {
150150
// Abort any pending lock requests.
151151
this.lockAbortController.abort();
152-
this.options.remote[Comlink.releaseProxy]();
153-
this.options.onClose?.();
154-
await this.baseConnection.close();
152+
try {
153+
await this.withRemote(() => this.baseConnection.close());
154+
} finally {
155+
this.options.remote[Comlink.releaseProxy]();
156+
this.options.onClose?.();
157+
}
155158
}
156159

157160
execute(sql: string, params?: any[]): Promise<ProxiedQueryResult> {

0 commit comments

Comments
 (0)