Skip to content

v12: release-age upgrade repeats the revalidation's conditional request #150

Closed
pnpm/pnpm
#17071

Description

@zkochan

Follow-up from #146. This is pnpm v12 only.

Behavior. Take an abbreviated mirror that holds the full document, recorded with fullEtag because a release-age upgrade stored it there. Each later install revalidates that mirror as the full document with its fullEtag and gets a 304. The document still lacks some versions' publish times, so the release-age upgrade then sends the same conditional request again and gets another 304. Each package in this state costs two identical conditional requests per install.

pnpm/crates/resolving-npm-resolver/src/pick_package/tests/upgraded_mirror_revalidation.rs pins this behavior. published_by_upgrade_of_an_upgraded_mirror_revalidates_with_the_full_etag expects four 304s over installs two and three.

pnpm v11 sends the request once since pnpm/pnpm#17066. There, the upgrade builds the same request as the revalidation, so memoizeFetchMetadata serves it the revalidation's 304.

Fix direction. When this pick's revalidation of the same document just answered 304, the upgrade can treat it as its own 304 and mark the packument checked. One way is to carry the revalidation's outcome into upgrade_for_release_age. Another is to coalesce identical conditional requests in the fetch layer, as v11 does. Then update the expected count in that test, so installs two and three send one request each.

This only affects registries whose full documents lack complete time maps. The npm registry's full documents have them.


Written by an agent (Claude Code, claude-opus-5-5).

Activity

  1. added a commit that references this issue on Oct 18, 2026
    06afcf6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions