From 2716d68b3d21d493cdfdefa0857fad4c6a3c522a Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Mon, 2 Nov 2026 18:55:48 +0000 Subject: [PATCH] Keep NFC E2E fixtures compatible with source checks --- test/e2e-obsidian/scripts/journal-nfc-resend.ts | 4 ++-- test/e2e-obsidian/scripts/p2p-nfc-sync.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e-obsidian/scripts/journal-nfc-resend.ts b/test/e2e-obsidian/scripts/journal-nfc-resend.ts index 6eac2e39..40fffc1e 100644 --- a/test/e2e-obsidian/scripts/journal-nfc-resend.ts +++ b/test/e2e-obsidian/scripts/journal-nfc-resend.ts @@ -178,8 +178,8 @@ async function assertSinglePhysicalUnicodeFile( ): Promise { const segments = relativePath.split("/"); const stableParent = join(vaultPath, ...segments.slice(0, -2)); - const expectedFolder = segments.at(-2)!.normalize("NFC"); - const expectedFilename = segments.at(-1)!.normalize("NFC"); + const expectedFolder = segments[segments.length - 2].normalize("NFC"); + const expectedFilename = segments[segments.length - 1].normalize("NFC"); const physicalFolders = (await readdir(stableParent, { withFileTypes: true })).filter( (entry) => entry.isDirectory() && entry.name.normalize("NFC") === expectedFolder ); diff --git a/test/e2e-obsidian/scripts/p2p-nfc-sync.ts b/test/e2e-obsidian/scripts/p2p-nfc-sync.ts index 4697fe2d..c236f4b2 100644 --- a/test/e2e-obsidian/scripts/p2p-nfc-sync.ts +++ b/test/e2e-obsidian/scripts/p2p-nfc-sync.ts @@ -2,7 +2,7 @@ import { randomBytes } from "node:crypto"; import { access, mkdir, readFile, readdir, writeFile } from "node:fs/promises"; import { connect } from "node:net"; import { dirname, join } from "node:path"; -import type { ObsidianLiveSyncSettings } from "@vrtmrz/livesync-commonlib/compat/common/types"; +import type { FilePathWithPrefix, ObsidianLiveSyncSettings } from "@vrtmrz/livesync-commonlib/compat/common/types"; import { encodeTimeBoundSetupURI } from "@vrtmrz/livesync-commonlib/setup-uri"; import { createNewVaultSettings, P2P_DEFAULT_SETTINGS, PREFERRED_BASE } from "@vrtmrz/livesync-commonlib/settings"; import { upsertRemoteConfigurationInPlace } from "@vrtmrz/livesync-commonlib/remote-configurations"; @@ -594,7 +594,7 @@ async function seedLegacyNfdMetadata( // Obsidian's file cache normalises names even in legacy mode. Seed the // legacy ID of an NFD-writing host while retaining real Chunk documents. const legacyId = await path2id_base( - pathNfd, + pathNfd as FilePathWithPrefix, shared.encrypted ? shared.e2eePassphrase : false, true, shared.encrypted ? shared.idKey : undefined