This commit is contained in:
Andras Schmelczer 2026-09-26 20:22:16 +01:00
commit b07aa589ff

View file

@ -7,7 +7,7 @@ import {
type StoredDatabase
} from "../sync-client/src/persistence/database";
import { FileOperations } from "../sync-client/src/file-operations/file-operations";
import { toStoredSnapshot } from "../sync-client/src/sync-operations/content";
import { toStoredSnapshot } from "../sync-client/src/snapshot";
import type { ServerConfig } from "../sync-client/src/services/server-config";
import { mergeFileManifests } from "../sync-client/src/sync-operations/file-manifest";
import { assertManifest, pathDecision } from "./oracles";
@ -35,7 +35,7 @@ async function fixture(
}
for (const [id, path] of Object.entries(initial.local))
initial.documents[id] = {
materialized: true,
observedHash: (
await toStoredSnapshot((await disk.read(path))!)
).hash
@ -73,7 +73,7 @@ async function swapFixture() {
const current = await fixture();
const next = structuredClone(current.initial);
next.local = { a: "b.md", b: "a.md", c: "nested/c.md" };
next.documents.c = { materialized: false };
next.documents.c = {};
const writes = {
c: { replacement: await toStoredSnapshot({ content: bytes("C") }) }
};
@ -274,7 +274,7 @@ for (const [name, create] of [
)) {
assert(
runtime.database.state.documents[id]
.materialized
.observedHash !== undefined
);
assert.equal(
runtime.database.state.documents[id]
@ -560,7 +560,7 @@ test("normalization-sensitive disk does not lose a distinct decomposed filename"
const runtime = current.restart();
const next = structuredClone(runtime.database.state);
next.local.composed = "é.md";
next.documents.composed = { materialized: true };
next.documents.composed = { observedHash: "" };
await runtime.database.commit(next);
await current.disk.userWrite("e\u0301.md", bytes("decomposed"));
await scanLocalFiles({