From 17bfa213f9b2333d107bbfb695e51d1648149a92 Mon Sep 17 00:00:00 2001 From: HerbCaudill Date: Thu, 30 Nov 2023 13:45:30 +0100 Subject: [PATCH] =?UTF-8?q?spelling=20-=20persistence=20=F0=9F=A4=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/automerge-repo/src/Repo.ts | 16 ++++++++-------- .../src/synchronizer/CollectionSynchronizer.ts | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/automerge-repo/src/Repo.ts b/packages/automerge-repo/src/Repo.ts index debcd363f..248183473 100644 --- a/packages/automerge-repo/src/Repo.ts +++ b/packages/automerge-repo/src/Repo.ts @@ -47,9 +47,9 @@ export class Repo extends EventEmitter { /** @hidden */ sharePolicy: SharePolicy = async () => true - /** maps peer id to to persistance information (storageId, isEphemeral), access by collection synchronizer */ + /** maps peer id to to persistence information (storageId, isEphemeral), access by collection synchronizer */ /** @hidden */ - persistanceInfoByPeerId: Record = {} + persistenceInfoByPeerId: Record = {} #remoteHeadsSubscriptions = new RemoteHeadsSubscriptions() @@ -160,7 +160,7 @@ export class Repo extends EventEmitter { this.#log("peer connected", { peerId }) if (storageId) { - this.persistanceInfoByPeerId[peerId] = { + this.persistenceInfoByPeerId[peerId] = { storageId, isEphemeral, } @@ -195,7 +195,7 @@ export class Repo extends EventEmitter { const handle = this.#handleCache[message.documentId] - const info = this.persistanceInfoByPeerId[message.peerId] + const info = this.persistenceInfoByPeerId[message.peerId] if (!info) { return } @@ -280,13 +280,13 @@ export class Repo extends EventEmitter { return } - const persistanceInfo = this.persistanceInfoByPeerId[message.peerId] + const persistenceInfo = this.persistenceInfoByPeerId[message.peerId] - if (!persistanceInfo || persistanceInfo.isEphemeral) { + if (!persistenceInfo || persistenceInfo.isEphemeral) { return } - const { storageId } = persistanceInfo + const { storageId } = persistenceInfo let handler = this.#throttledSaveSyncStateHandlers[storageId] if (!handler) { @@ -453,7 +453,7 @@ export class Repo extends EventEmitter { } } -interface PersistanceInfo { +interface PersistenceInfo { storageId: StorageId isEphemeral: boolean } diff --git a/packages/automerge-repo/src/synchronizer/CollectionSynchronizer.ts b/packages/automerge-repo/src/synchronizer/CollectionSynchronizer.ts index 231db3d65..13760c35d 100644 --- a/packages/automerge-repo/src/synchronizer/CollectionSynchronizer.ts +++ b/packages/automerge-repo/src/synchronizer/CollectionSynchronizer.ts @@ -42,14 +42,14 @@ export class CollectionSynchronizer extends Synchronizer { return } - const persistanceInfo = this.repo.persistanceInfoByPeerId[peerId] - if (!persistanceInfo || persistanceInfo.isEphemeral) { + const persistenceInfo = this.repo.persistenceInfoByPeerId[peerId] + if (!persistenceInfo || persistenceInfo.isEphemeral) { return } return this.repo.storageSubsystem.loadSyncState( handle.documentId, - persistanceInfo.storageId + persistenceInfo.storageId ) }, })