Skip to content

Commit

Permalink
Merge pull request #236 from automerge/spelling-persistence
Browse files Browse the repository at this point in the history
spelling - persistence
  • Loading branch information
pvh authored Nov 30, 2023
2 parents 11805d6 + 17bfa21 commit 4b67a1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions packages/automerge-repo/src/Repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export class Repo extends EventEmitter<RepoEvents> {
/** @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<PeerId, PersistanceInfo> = {}
persistenceInfoByPeerId: Record<PeerId, PersistenceInfo> = {}

#remoteHeadsSubscriptions = new RemoteHeadsSubscriptions()

Expand Down Expand Up @@ -160,7 +160,7 @@ export class Repo extends EventEmitter<RepoEvents> {
this.#log("peer connected", { peerId })

if (storageId) {
this.persistanceInfoByPeerId[peerId] = {
this.persistenceInfoByPeerId[peerId] = {
storageId,
isEphemeral,
}
Expand Down Expand Up @@ -195,7 +195,7 @@ export class Repo extends EventEmitter<RepoEvents> {

const handle = this.#handleCache[message.documentId]

const info = this.persistanceInfoByPeerId[message.peerId]
const info = this.persistenceInfoByPeerId[message.peerId]
if (!info) {
return
}
Expand Down Expand Up @@ -280,13 +280,13 @@ export class Repo extends EventEmitter<RepoEvents> {
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) {
Expand Down Expand Up @@ -453,7 +453,7 @@ export class Repo extends EventEmitter<RepoEvents> {
}
}

interface PersistanceInfo {
interface PersistenceInfo {
storageId: StorageId
isEphemeral: boolean
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
},
})
Expand Down

0 comments on commit 4b67a1b

Please sign in to comment.