Skip to content

Commit

Permalink
lint: fix unrelated issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Oct 19, 2024
1 parent da9e5d6 commit 14ba8ae
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/backend/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Producer, produce, consume } from '@ndn/endpoint'
import { Name, Interest, Component } from '@ndn/packet'

Check warning on line 4 in src/backend/main.ts

View workflow job for this annotation

GitHub Actions / ESLint

src/backend/main.ts#L4

'Component' is defined but never used (@typescript-eslint/no-unused-vars)
import * as nfdmgmt from '@ndn/nfdmgmt'
import { getYjsDoc} from '@syncedstore/core'
import { getYjsDoc } from '@syncedstore/core'
import * as Y from 'yjs'
import { CertStorage } from '@ucla-irl/ndnts-aux/security'
import { RootDocStore, initRootDoc, project, profiles, connections } from './models'
Expand Down Expand Up @@ -234,18 +234,17 @@ export async function bootstrapWorkspace(opts: {
let targetSVEncoded = targetName.at(-1).value
// load local state first with the snapshot.
await persistStore.set('localState', targetSVEncoded)
// Merge the SV with the local one so that when SyncAgent starts up,

// Merge the SV with the local one so that when SyncAgent starts up,
// it replays the local updates (in local storage), starting from snapshot's vector.
let localSVEncoded = await persistStore.get(aloSyncKey)
const localSVEncoded = await persistStore.get(aloSyncKey)
if (localSVEncoded) {
let localSV = Decoder.decode(localSVEncoded, StateVector)
let targetSV = Decoder.decode(targetSVEncoded, StateVector)
const localSV = Decoder.decode(localSVEncoded, StateVector)
const targetSV = Decoder.decode(targetSVEncoded, StateVector)
targetSV.mergeFrom(localSV)
targetSVEncoded = Encoder.encode(targetSV)
}
await persistStore.set(aloSyncKey, targetSVEncoded)

} catch (err: any) {

Check warning on line 248 in src/backend/main.ts

View workflow job for this annotation

GitHub Actions / ESLint

src/backend/main.ts#L248

Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)
console.warn(err)
console.log('Aborting snapshot retrieval, falling back to SVS')
Expand Down

0 comments on commit 14ba8ae

Please sign in to comment.