Skip to content

fix: eliminate all 34 integration test failures (phantom suites + real bugs)#56

Merged
jnahian merged 5 commits into
feat/v0.3-agent-integrationfrom
fix/integration-test-failures
Jul 16, 2026
Merged

fix: eliminate all 34 integration test failures (phantom suites + real bugs)#56
jnahian merged 5 commits into
feat/v0.3-agent-integrationfrom
fix/integration-test-failures

Conversation

@jnahian

@jnahian jnahian commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

The integration suite (npm run test) had 34 long-standing failures. Root-causing them found they were three different problems stacked together — roughly half weren't real test failures at all:

1. Phantom suites from stale build artifacts (17 failures). tsc never deletes outputs for removed sources, so out/test/suite/ still contained compiled suites from old feature branches (searchManager.test.js, sidebarProvider.test.js, tagManager.test.js) whose .ts sources don't exist in this tree — including every filterByTags/stop-words failure. pretest now cleans out/ before compiling.

2. Real product bugs (11 failures):

  • Soft-delete cache corruptiongetNotesForFile cached a pre-filtered (deleted-excluded) list into the cache shared with getAllNotesForFile, and deleteNote removed soft-deleted notes from the cache entirely. Result: "already deleted" errors reported "not found", and deleted notes vanished from history-preserving lookups. The cache now always holds all notes, filtered at return; getNoteById no longer returns soft-deleted notes.
  • getCurrentlyEditingComment never worked — it looked up commentThreads (keyed by file:line) with a note id. The thread key is now tracked alongside the editing note id.
  • Comment labels always said "Last updated" — the creation history entry counted as an update; fresh notes now show "Created".
  • CodeLens multiline previews merged all lines — markdown stripping collapses newlines, so the first-line split happened too late; also strips stray mid-text ## markers.
  • stripMarkdown image bug — the link regex consumed [alt](url) before the image regex saw ![alt](url), leaving a stray !.
  • truncateText(_, 3) returned a clipped fragment instead of the ellipsis.
  • Sidebar note children unsorted when FileTreeItem is constructed directly (sort was dropped in the v0.3 sidebar refactor).

3. Test-infra bugs (6 failures): mock document paths collided on Date.now() within the same millisecond; comment-controller flows that reopen documents from disk pointed at files that were never written; one test didn't await the now-async updateCommentThread; one asserted null where the API returns undefined.

Test plan

  • npm run test265 passing, 0 failing (was 364 passing / 34 failing; the count shrank because ~100 phantom tests are gone)
  • npm run test:unit — 60/60
  • npm run compile:tsc + npm run compile — clean

Notes

🤖 Generated with Claude Code

jnahian and others added 5 commits July 16, 2026 23:51
tsc never deletes outputs for removed sources, so out/test/suite kept
stale compiled suites from old branches (searchManager, sidebarProvider,
tagManager) — ~100 phantom tests failing against code that doesn't
exist in this tree. pretest now cleans out/ first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- getNotesForFile cached a pre-filtered list from storage.loadNotes,
  hiding deleted notes from getAllNotesForFile cache hits; the cache
  now always holds all notes and filters at return
- deleteNote removed the soft-deleted note from the cache instead of
  updating it, turning 'already deleted' errors into 'not found'
- getNoteById no longer returns soft-deleted notes to consumers

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- getCurrentlyEditingComment looked up commentThreads (keyed by
  file:line thread key) with a note id, so it always returned null;
  the thread key is now tracked alongside the editing note id
- Comment labels always said 'Last updated' because the creation
  history entry counted as an update; fresh notes now show 'Created'

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- CodeLens: take the first line before stripping markdown (the strip
  collapses newlines, merging every line into the preview) and strip
  heading markers that appear mid-text
- noteTreeItem: strip image markdown before link markdown so
  ![alt](url) doesn't leave a stray '!'; truncateText returns the
  ellipsis itself when maxLength <= 3 instead of a clipped fragment
- Sidebar: sort note children by line number — callers may construct
  FileTreeItem with notes in any order

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Mock document paths used Date.now() alone — two docs created in the
  same millisecond collided on the same fsPath; added a sequence counter
- CommentController flows that reopen the document from disk now write
  the file first (openTextDocument was failing on nonexistent paths)
- await the now-async updateCommentThread; assert falsy instead of
  null for deleted-note lookup (API returns undefined)
- Changelog: record the fixes under v0.3.0

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
code-context-notes Ready Ready Preview, Comment Jul 16, 2026 5:52pm

@jnahian jnahian merged commit 965a968 into feat/v0.3-agent-integration Jul 16, 2026
2 checks passed
@jnahian jnahian deleted the fix/integration-test-failures branch July 16, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant