,,
This commit is contained in:
parent
0c75d3b4c2
commit
3dab48f58b
1 changed files with 1141 additions and 1376 deletions
|
|
@ -8,7 +8,7 @@ import {
|
|||
import { Settings } from "../sync-client/src/persistence/settings";
|
||||
import { FileOperations } from "../sync-client/src/file-operations/file-operations";
|
||||
import { Syncer } from "../sync-client/src/sync-operations/syncer";
|
||||
import { toStoredSnapshot } from "../sync-client/src/snapshot";
|
||||
import { hashSnapshot } from "../sync-client/src/snapshot";
|
||||
import { Logger } from "../sync-client/src/tracing/logger";
|
||||
import { SyncHistory } from "../sync-client/src/tracing/sync-history";
|
||||
import { FixedSizeDocumentCache } from "../sync-client/src/utils/data-structures/fix-sized-cache";
|
||||
|
|
@ -56,6 +56,7 @@ async function fixture(syncIntervalMs: number | undefined) {
|
|||
const batch = (after = 2): EventBatch =>
|
||||
structuredClone({
|
||||
headEventId,
|
||||
endEventId: headEventId,
|
||||
events: events.filter((event) => event.eventId > after)
|
||||
});
|
||||
const service: Partial<SyncService> = {
|
||||
|
|
@ -90,7 +91,7 @@ async function fixture(syncIntervalMs: number | undefined) {
|
|||
initial.lastSeenUpdateId = 2;
|
||||
initial.local = { [documentId]: "note.bin" };
|
||||
initial.fileManifest = { fileManifestId: 2, entries: { ...initial.local } };
|
||||
const hash = (await toStoredSnapshot({ content: bytes("base") })).hash;
|
||||
const hash = (await hashSnapshot({ content: bytes("base") })).hash;
|
||||
initial.documents[documentId] = {
|
||||
remote: latest,
|
||||
observedHash: hash,
|
||||
|
|
@ -123,7 +124,6 @@ async function fixture(syncIntervalMs: number | undefined) {
|
|||
>()
|
||||
};
|
||||
const syncer = new Syncer(
|
||||
"device",
|
||||
logger,
|
||||
database,
|
||||
settings,
|
||||
|
|
|
|||
Loading…
Reference in a new issue