Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
Settle seven parked node-tier tests: pins, retitles, one revive (#5152)
Nick Gomez93ca0dd94fd6
diff --git a/packages/app/src/editor/source-undo-mode-flip.test.ts b/packages/app/src/editor/source-undo-mode-flip.test.tsindex 217cf4a34..ae51948cf 100644--- a/packages/app/src/editor/source-undo-mode-flip.test.ts+++ b/packages/app/src/editor/source-undo-mode-flip.test.ts@@ -144,7 +144,7 @@ describe('createSourceUndoFlipTracker', () => {expect(ytext.toString()).toBe(' rewritten');});- test('characterization: an untracked rewrite while active leaves both bursts in one undo frame', () => {+ test('an untracked rewrite while source mode is active keeps both typing bursts in one undo frame', () => {const { ytext, undoManager, tracker, trackedEdit, untrackedEdit } = makeRig();tracker.setSourceModeActive(true);diff --git a/packages/app/tests/integration/showall-single-flight.test.ts b/packages/app/tests/integration/showall-single-flight.test.tsindex 09e77f3a2..6c3049a66 100644--- a/packages/app/tests/integration/showall-single-flight.test.ts+++ b/packages/app/tests/integration/showall-single-flight.test.ts@@ -7,7 +7,7 @@ import {__resetShowAllWalkStatsForTesting,} from '@inkeep/open-knowledge-server';import { afterAll, beforeAll, describe, expect, test } from 'vitest';-import { createTestServer, pollUntil, type TestServer } from './test-harness';+import { createTestServer, type TestServer } from './test-harness';const ROOT_FILE_COUNT = 1500;const NESTED_DIR_COUNT = 30;@@ -127,22 +127,6 @@ describe('showOk single-flight isolation', () => {});describe('abort-on-disconnect (AC4)', () => {- test.skip('a disconnect with no other waiter aborts the shared walk', async () => {- __resetShowAllWalkStatsForTesting();- const controller = new AbortController();- const rejected = fetch(showAllUrl(), { signal: controller.signal }).then(- () => false,- () => true,- );-- await pollUntil(() => __getShowAllWalkStatsForTesting().invocations >= 1, 12_000, 5);- controller.abort();-- await pollUntil(() => __getShowAllWalkStatsForTesting().aborts >= 1, 12_000, 5);- expect(__getShowAllWalkStatsForTesting().aborts).toBe(1);- expect(await rejected).toBe(true);- }, 30_000);-test('a normally-completed request never triggers an abort', async () => {__resetShowAllWalkStatsForTesting();const res = await fetch(showAllUrl());diff --git a/packages/desktop/tests/integration/auto-updater.test.ts b/packages/desktop/tests/integration/auto-updater.test.tsindex 0be0e2d7e..c987403c6 100644--- a/packages/desktop/tests/integration/auto-updater.test.ts+++ b/packages/desktop/tests/integration/auto-updater.test.ts@@ -5,6 +5,7 @@ import { dirname, join } from 'node:path';import { fileURLToPath } from 'node:url';import { MANUAL_CHECK_WATCHDOG_MS } from '@inkeep/open-knowledge-core';import { describe, expect, test, vi } from 'vitest';+import { expectKnownBug } from '../../../../test-support/known-bug.vitest.test-helper';import {bootAutoUpdater,buildCheckNowResultFromError,@@ -2604,9 +2605,33 @@ describe('boot-time failed-install detection — install still in flight', () =>);});- test.todo(- 'an unobserved commit on a same-MMP beta bump survives a SECOND reopen (needs PRD-8291)',- );+ test('an unobserved commit on a same-MMP beta bump survives a second reopen inside the window', {+ tags: ['known-bug'],+ meta: {+ issue: 'https://linear.app/inkeep/issue/PRD-8291',+ owner: 'get-main-green',+ until: '2026-12-01',+ },+ }, async () => {+ const RUNNING_BETA = '0.54.0-beta.0';+ const ATTEMPTED_BETA = '0.54.0-beta.1';+ const first = reopenAt(+ await stageAndCommit('unobserved-quit', {+ running: RUNNING_BETA,+ attempted: ATTEMPTED_BETA,+ }),+ new Date(STAGED_AT.getTime() + 45 * SECOND),+ RUNNING_BETA,+ );+ expect(first.dispatches).toContain('install-in-flight-deferred' as DispatchKind);++ const second = reopenAt(first.state, new Date(STAGED_AT.getTime() + 3 * MINUTE), RUNNING_BETA);+ await expectKnownBug(/install-never-committed-reoffered/, () => {+ expect(second.dispatches).toContain('install-in-flight-deferred' as DispatchKind);+ expect(second.dispatches).not.toContain('install-never-committed-reoffered' as DispatchKind);+ expect(failureCards(second)).toHaveLength(0);+ });+ });test('a same-MMP beta bump survives a SECOND reopen inside the window', async () => {const RUNNING_BETA = '0.54.0-beta.0';diff --git a/packages/server/src/git-checkout.test.ts b/packages/server/src/git-checkout.test.tsindex 8d648f2fe..97caf8dfb 100644--- a/packages/server/src/git-checkout.test.ts+++ b/packages/server/src/git-checkout.test.ts@@ -130,7 +130,7 @@ describe('isBranchInOtherWorktreeError', () => {expect(result).toEqual({ held: true, path: '/Users/Me/My Repo/wt' });});- test('truncates a path containing an apostrophe at the first inner quote (known limitation)', () => {+ test('worktree stderr parsing truncates an apostrophe-containing path at that apostrophe', () => {const result = isBranchInOtherWorktreeError(new Error("fatal: 'feat' is already checked out at '/Users/me/it's-fine/wt'"),);diff --git a/packages/server/src/http/document-routes.test.ts b/packages/server/src/http/document-routes.test.tsindex 05c679dab..0da860d95 100644--- a/packages/server/src/http/document-routes.test.ts+++ b/packages/server/src/http/document-routes.test.ts@@ -1,4 +1,5 @@import { mkdirSync, mkdtempSync, rmSync } from 'node:fs';+import { ServerResponse } from 'node:http';import { tmpdir } from 'node:os';import { join } from 'node:path';import { Hocuspocus } from '@hocuspocus/server';@@ -7,8 +8,9 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest';import { makeCaptureRes, makeSyntheticReq } from '../composition-rig.test-helper.ts';import { createTestConflictAuthority } from '../conflict-authority.test-helper.ts';import type { ConflictAuthority } from '../conflict-authority.ts';+import { createContentFilter } from '../content-filter.ts';import { loggerFactory } from '../logger.ts';-import { createDocumentRoutes } from './document-routes.ts';+import { createDocumentRoutes, type DocumentRouteDeps } from './document-routes.ts';const DOC_NAME = 'notes/topic';const DOC_FILE = 'notes/topic.md';@@ -24,7 +26,11 @@ afterEach(() => {rmSync(projectDir, { recursive: true, force: true });});-function buildGroup(conflicts: ConflictAuthority, hocuspocus: Hocuspocus) {+function buildGroup(+ conflicts: ConflictAuthority,+ hocuspocus: Hocuspocus,+ overrides: Partial<DocumentRouteDeps> = {},+) {return createDocumentRoutes({hocuspocus,conflicts,@@ -50,6 +56,7 @@ function buildGroup(conflicts: ConflictAuthority, hocuspocus: Hocuspocus) {getFolderIndex: undefined,getFolderAliasIndex: undefined,onReferencedAssetsCacheInvalidator: undefined,+ ...overrides,});}@@ -115,3 +122,33 @@ describe('/api/document lifecycle reflects the conflict ledger', () => {}});});++describe('/api/documents?showAll single-flight walk', () => {+ test('a disconnect with no other waiter aborts the shared walk', async () => {+ const started = Promise.withResolvers<AbortSignal>();+ const walk = Promise.withResolvers<{ truncated: boolean }>();+ const resolved = buildGroup(+ createTestConflictAuthority(projectDir),+ new Hocuspocus({ quiet: true }),+ {+ contentFilter: createContentFilter({ projectDir, contentDir: projectDir }),+ walkContentDirForShowAll: ({ signal }) => {+ started.resolve(signal);+ return walk.promise;+ },+ },+ ).table.resolve('/api/documents');+ if (!resolved?.dispatch) throw new Error('no dispatch for /api/documents');+ const req = makeSyntheticReq({ url: '/api/documents?showAll=true' });+ const res = new ServerResponse(req);+ const pending = resolved.dispatch(req, res);++ const signal = await started.promise;+ expect(signal.aborted).toBe(false);+ res.emit('close');+ expect(signal.aborted).toBe(true);++ walk.resolve({ truncated: false });+ await pending;+ });+});