Skip to content

Commit

Permalink
FIX multiInstance on remove
Browse files Browse the repository at this point in the history
  • Loading branch information
pubkey committed Nov 27, 2024
1 parent 2517d92 commit c74b089
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rx-collection-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export async function removeCollectionStorages(
databaseInstanceToken: string,
databaseName: string,
collectionName: string,
multiInstance: boolean,
password?: string,
/**
* If no hash function is provided,
Expand Down Expand Up @@ -134,11 +135,12 @@ export async function removeCollectionStorages(
databaseInstanceToken,
databaseName,
/**
* multiInstance must be set to true,
* multiInstance must be set to true if multiInstance
* was true on the database
* so that the storageInstance can inform other
* instances about being removed.
*/
multiInstance: true,
multiInstance,
options: {},
schema: row.schema,
password,
Expand Down
1 change: 1 addition & 0 deletions src/rx-collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ export class RxCollectionBase<
this.database.token,
this.database.name,
this.name,
this.database.multiInstance,
this.database.password,
this.database.hashFunction
);
Expand Down
2 changes: 2 additions & 0 deletions src/rx-database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ export function createRxDatabase<
export async function removeRxDatabase(
databaseName: string,
storage: RxStorage<any, any>,
multiInstance: boolean = true,
password?: string
): Promise<string[]> {
const databaseInstanceToken = randomToken(10);
Expand All @@ -700,6 +701,7 @@ export async function removeRxDatabase(
databaseInstanceToken,
databaseName,
collectionName,
multiInstance,
password
))
);
Expand Down

0 comments on commit c74b089

Please sign in to comment.