Skip to content

fix: preserve newer pending file reads - #844

Open
mikemikimike wants to merge 2 commits into
Nano-Collective:mainfrom
mikemikimike:fix/840-file-cache-pending-read-cleanup
Open

fix: preserve newer pending file reads#844
mikemikimike wants to merge 2 commits into
Nano-Collective:mainfrom
mikemikimike:fix/840-file-cache-pending-read-cleanup

Conversation

@mikemikimike

Copy link
Copy Markdown
Contributor

Summary

  • Make pending-read cleanup owner-aware on the mtime invalidation path.
  • Only remove a pending read when the map still points to the same Promise.
  • Add a deterministic regression test that prevents an older read from clearing a replacement read.

Fixes #840

Validation

  • pnpm run test:ava source/utils/file-cache.spec.ts — 19 passed
  • pnpm test:format — passed
  • pnpm test:types — passed
  • pnpm test:lint — passed
  • pnpm test:knip — passed
  • pnpm audit --registry=https://registry.npmjs.org --audit-level=high --ignore-unfixable — passed

The repository's pnpm run test:all wrapper cannot start on Windows because it invokes ./scripts/test.sh. Running the equivalent commands individually reached existing full-suite failures/timeouts in acp-content.spec.ts and ai-sdk-client tests; the focused file-cache suite passes.

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.

[Bug] Race Condition in Concurrent File Cache Reads

1 participant