v0.3.2 — idempotent upgrades (clean re-run of protect)
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
patchStartis 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
patchstackFunctionGuardinfunctionMiddlewarewith no
duplicate request guard, and re-running reports "already wired".
No API changes. Requires Node >= 18.