Separate background fetch state from cache values#405
Separate background fetch state from cache values#405Sean-Kenneth-Doherty wants to merge 1 commit into
Conversation
|
Validation for head
I also checked the worktree after |
|
This is an ok approach, but it has some problems that need to be fixed prior to landing. In general, separating out the backgroundFetch add-on properties to separate lists is the goal. But there's some slop that I don't think got proper human attention. In addition to the agent's findings below, the I haven't done a comprehensive benchmark yet, but if the tests time out... something is probably not great in there 😅 tl;dr summary:
Here's what Claude had to say about it, more verbose and detailed: Issues1.
|
|
This is likely at least part of the perf regression. On line 2335, you're doing this: const bf = this.#abortBackgroundFetch(head, new Error('evicted'))Previously, the code only created an Error object if there is actually a backgroundFetch to abort. if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
v.__abortController.abort(new Error('evicted'))
}Creating that |
Summary
#valListvalue-only and store in-flight fetch promises in#fetchListFixes #287.
Tests
npm run preparenpx oxlint src testnpx prettier --check src/index.ts test/fetch.ts tap-snapshots/test/tracing.ts.test.cjsnpx tap --statements=0 --branches=0 --lines=0 --functions=0 test/fetch.tsnpx tap --timeout=120 --statements=0 --branches=0 --lines=0 --functions=0 test/tracing.tsnpx tap --timeout=120 --reporter=terse