Skip to content

fix(pacquet): fresh vs frozen install report identical downloads inconsistently (found_in_store vs fetched) #12235

Description

@zkochan

Summary

A cold pacquet install (fresh-resolve) and pacquet install --frozen-lockfile perform the same tarball downloads, but report them completely differently:

  • fresh downloads via PrefetchingResolverDownloadTarballToStore, whose progress is emitted on a silent reporter, so the downloads are invisible. CreateVirtualStore then finds the freshly-populated store and emits found_in_store for every package. Net reporter output: "reused N, downloaded 0" — even though it downloaded all N.
  • frozen (and the pnpr path, which forces frozen) downloads through the visible cold-batch path and emits fetched + "Downloading : X MB/Y MB" progress. Net output: "downloaded N".

Same bytes, same network, opposite report. The fresh path hides its downloads.

Why this matters

This inconsistency is actively misleading. It made a --frozen-lockfile / pnpr install look like it was redundantly downloading a graph that a plain install "reused" — when both download identically. It cost a long false-positive investigation chasing a non-existent "frozen re-downloads everything" bug; the only real difference is overlap (see companion pipelining issue) and these labels.

Evidence

Instrumented the three decision points in DownloadTarballToStore::run_without_mem_cache (real network GET vs. prefetched/cached reuse) and the CreateVirtualStore warm-batch emit:

fresh:   58 NETWORK-DOWNLOAD  +  58 warm-batch-reuse   ->  reporter shows found_in_store=58, downloaded=0
frozen:  58 NETWORK-DOWNLOAD                           ->  reporter shows fetched=58

Where it lives

Proposal

Make the two paths report the same install identically. A package whose bytes came over the network this install should be reported as fetched/downloaded regardless of whether the fetch happened in the resolve-time prefetcher or the cold batch; found_in_store should mean it was genuinely already in the store at install start. Parity target: upstream pnpm's packageRequester emits fetchingProgress / packageImportMethod consistently whether or not the fetch was prefetched.

Acceptance

  • A cold pacquet install reports its prefetch downloads as downloads, not found_in_store — so pacquet install and pacquet install --frozen-lockfile produce the same reused/downloaded counts for the same cold store.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions