GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Expire cooldown rewrites when a withheld version becomes available by simonchrz · Pull Request #638 · git-pkgs/proxy

Conversation

@simonchrz

@simonchrz simonchrz commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #633. A rewrite cached with cooldown on expired after a fixed time (an hour, less with short cooldowns), so with a 3d cooldown every packument was rewritten again each hour, for pnpm 12 the whole lockfile.

A cached rewrite only goes wrong when a version it held back leaves cooldown: versions it let through stay allowed, and a new upstream version changes the document and so the cache key. So it now expires then.

  • Handlers ask cooldown through Proxy.cooldown(), which reports the availability time (Decision.AvailableAt) of each version it holds back to the rewrites running at that moment. A rewrite expires at the earliest one.
  • A rewrite can hear of a version another rewrite held back at the same time. That only makes it expire earlier, never later, and keeps the ecosystems' filters as they are.
  • A rewrite that held nothing back, or held back a version without a known time, is kept for the shortest cooldown configured, at least a minute and at most a day.
  • A test fails when a handler asks Proxy.Cooldown directly, since that decision would not reach the rewrites.

Tested through the npm and Composer handlers: a version published 2h ago with a 3h cooldown gives an entry that expires an hour later.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@simonchrz
Expire cooldown rewrites when a withheld version becomes available
39d178f
A cached rewrite made with cooldown on stays right until a version it held
back leaves cooldown, so it now expires then instead of after a fixed
time. Handlers ask cooldown through Proxy.cooldown, which reports each
withheld version to the rewrites running at that moment. A rewrite that
held nothing back is kept for the shortest cooldown, at most a day.
@simonchrz simonchrz added the enhancement New feature or request label Oct 30, 2026
@simonchrz simonchrz mentioned this pull request Oct 30, 2026
Stream npm packuments through storage when rewriting them #640
Merged
@simonchrz
simonchrz requested a review from andrew October 30, 2026 13:32
andrew
andrew approved these changes Oct 30, 2026
View reviewed changes

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expiry recorder covers the cooldown decisions made during cached rewrites, and the handler tests cover the npm and Composer expiry paths.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andrew
andrew merged commit cb566d5 into git-pkgs:main Oct 30, 2026
7 checks passed

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@andrew andrew andrew approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement New feature or request

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@simonchrz @andrew
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.