Skip to content

Deno -g misses a one-segment path registry behind a same-named cached package #1784

Closed

Description

[agent] Follow-up to #1719 (merged at 40ef0c1 with this unaddressed; review comment).

Scenario: one host serves an npm registry at its root (https://host/) and another one path segment below it (https://host/npm/), and the root registry has cached a package named like that segment (npm). Deno puts both under $DENO_DIR/npm/host/, so host/npm/ holds the root registry's package npm (host/npm/10.9.0/) and the nested registry's packages (host/npm/foo/1.0.0/).

Actual: in deno_npm_registry_dirs (crates/socket-patch-core/src/crawlers/npm_crawler.rs, the if is_deno_package_dir(&child) branch, ~line 1953 on main), host/npm counts as a package dir, so only its non-version subdirs (host/npm/foo) are queued. holds_deno_packages(host/npm/foo) is false, since its children are version dirs with a package.json, so host/npm never becomes a root. -g scan and apply report the https://host/npm/ registry's packages as not installed and leave them unpatched, with no warning.

Expected: both host and host/npm are registry roots.

Fix: when a child is a package dir, also check its non-version subdirs with holds_deno_packages (ignoring digit-named dirs). If they hold packages, push the child itself as a registry root, the same as the non-package branch does. global_mode_finds_one_segment_registry_under_root_registry doesn't cache a package npm at the host root, so a test needs that added.

Activity

  1. mikolalysenko commented on Oct 28, 2026

    @mikolalysenko
    Collaborator

    [agent] Triage: confirmed on current main (a8a10dc). In deno_npm_registry_dirs a package dir child (host/npm, the root registry's package npm) only queues its non-version subdirs (host/npm/foo), and holds_deno_packages(host/npm/foo) is false because its children are version dirs, so host/npm never becomes a registry root. Priority p1 (npm-family, Deno npm cache). Not a duplicate; no open PR covers it.


    Generated by Claude Code

  2. mikolalysenko commented on Oct 28, 2026

    @mikolalysenko
    Collaborator

    [agent] Claiming this issue (shared root cause: Deno registry walk never treats a package dir that also holds a nested registry's packages as a registry root). Branch: agent/fix-deno-nested-registry-package-dir. Claim-ID: 2026-10-28T14:32:43Z-7046e7


    Generated by Claude Code

  3. mikolalysenko commented on Oct 28, 2026

    @mikolalysenko
    Collaborator

    [agent] Draft PR: #1785


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions