diff --git a/packages/snjs/lib/Application/Dependencies/Dependencies.ts b/packages/snjs/lib/Application/Dependencies/Dependencies.ts index ea5345ce3..4b48718b4 100644 --- a/packages/snjs/lib/Application/Dependencies/Dependencies.ts +++ b/packages/snjs/lib/Application/Dependencies/Dependencies.ts @@ -1529,7 +1529,6 @@ export class Dependencies { this.get(TYPES.HttpService), this.get(TYPES.DiskStorageService), this.options.defaultHost, - this.options.identifier, this.get(TYPES.InMemoryStore), this.get(TYPES.Crypto), this.get(TYPES.SessionStorageMapper), diff --git a/packages/snjs/lib/Migrations/Versions/2_204_8.ts b/packages/snjs/lib/Migrations/Versions/2_204_8.ts deleted file mode 100644 index 735e33e1e..000000000 --- a/packages/snjs/lib/Migrations/Versions/2_204_8.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ApplicationStage, StorageKey } from '@standardnotes/services' -import { Migration } from '@Lib/Migrations/Migration' - -export class Migration2_204_8 extends Migration { - static override version(): string { - return '2.204.8' - } - - protected registerStageHandlers(): void { - this.registerStageHandler(ApplicationStage.Launched_10, async () => { - await this.migrateHostKeyStoredToWorkspaceIdentified() - - this.markDone() - }) - } - - private async migrateHostKeyStoredToWorkspaceIdentified(): Promise { - const existingHostKeyValue = this.services.storageService.getValue(StorageKey.ServerHost) - if (existingHostKeyValue === undefined) { - return - } - - this.services.storageService.setValue(`${StorageKey.ServerHost}:${this.services.identifier}`, existingHostKeyValue) - - await this.services.storageService.removeValue(StorageKey.ServerHost) - } -} diff --git a/packages/snjs/lib/Services/Api/ApiService.ts b/packages/snjs/lib/Services/Api/ApiService.ts index ca127c99e..3ff24fb22 100644 --- a/packages/snjs/lib/Services/Api/ApiService.ts +++ b/packages/snjs/lib/Services/Api/ApiService.ts @@ -106,7 +106,6 @@ export class LegacyApiService private httpService: HttpServiceInterface, private storageService: DiskStorageService, private host: string, - private workspaceIdentifier: string, private inMemoryStore: KeyValueStoreInterface, private crypto: PureCryptoInterface, private sessionStorageMapper: MapperInterface>, @@ -143,16 +142,14 @@ export class LegacyApiService } public loadHost(): string { - const storedValue = this.storageService.getValue( - `${StorageKey.ServerHost}:${this.workspaceIdentifier}`, - ) + const storedValue = this.storageService.getValue(StorageKey.ServerHost) this.host = storedValue || this.host return this.host } public async setHost(host: string): Promise { this.host = host - this.storageService.setValue(`${StorageKey.ServerHost}:${this.workspaceIdentifier}`, host) + this.storageService.setValue(StorageKey.ServerHost, host) } public getHost(): string { diff --git a/packages/snjs/lib/Services/Session/SessionManager.ts b/packages/snjs/lib/Services/Session/SessionManager.ts index 68df3e3d7..72cbcb4da 100644 --- a/packages/snjs/lib/Services/Session/SessionManager.ts +++ b/packages/snjs/lib/Services/Session/SessionManager.ts @@ -169,7 +169,7 @@ export class SessionManager } } - const serverHost = this.storage.getValue(`${StorageKey.ServerHost}:${this.workspaceIdentifier}`) + const serverHost = this.storage.getValue(StorageKey.ServerHost) if (serverHost) { void this.apiService.setHost(serverHost) this.httpService.setHost(serverHost)