Skip to content

v0.3.2 — idempotent upgrades (clean re-run of protect)

Choose a tag to compare

@devlob devlob released this 13 Jul 15:53
e33e1e4

Re-running protect now reconciles cleanly across upgrades

0.3.1 added the server-function guard, but protect's idempotency check keyed off a single
marker (patchstackGuard) — so re-running it on an app already wired by 0.3.0 silently did
nothing, and that app never gained the new function-middleware guard.

Fix

  • patchStart is now idempotent per piece. It extends the guard import, adds each middleware
    definition, and registers each guard only when missing. So installing on a fresh app wires
    everything; re-running after a connect upgrade adds exactly the newly-introduced pieces (no
    duplication); a second run is a no-op.
  • Verified: an app wired by 0.3.0 gains patchstackFunctionGuard in functionMiddleware with no
    duplicate request guard, and re-running reports "already wired".

No API changes. Requires Node >= 18.