You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(routing): close three byte-identity gaps in the URL generator (review)
A deep parity review (+ two adversarial audits) of the route() fast path against
vanilla's full RouteUrlGenerator::to() found three issues. All proven against a
vanilla oracle before/after, and regression-tested.
1. Empty-string param value (BYTE-IDENTITY): route('u', ['user' => '']) returned
/api/users; vanilla treats '' as a *missing* named param (leaves {user} literal)
and throws UrlGenerationException. Now defers on $value === ''.
2. Duplicate parameter names (BYTE-IDENTITY): {a}/{a} positional returned /api/5/6;
vanilla fills the first {a} and throws on the second. greaseCompileEntry now
returns false for routes with duplicate param names (never indexed).
3. forceRootUrl()/useOrigin() with a path, relative URL (BYTE-IDENTITY): the
relative shortcut never consulted formatRoot(), dropping a forced root path
('/app/...' -> '/...'). The relative branch now derives from the full absolute
URI and applies vanilla's exact root+base-path strip, so forced-root paths and
subdirectory base paths are preserved (and the prior subdirectory defer is gone —
broader coverage, all byte-identical).
4. Prewarm seed wiped under route:cache (PERF, not correctness): the framework's
booted-phase cached-routes load rebinds 'routes' -> setRoutes() -> flush, which
wiped a boot()-time URL-index seed. Seeding now runs on an app->booted() callback
(registered after RouteServiceProvider's), so it lands after the route load and
survives into requests. (Lazy fallback was already byte-identical; this restores
the intended FPM/Octane prewarm.)
Provider rebind, signed URLs, Octane persistence, command enumeration, and L10-13
container semantics all audited clean (no breaking changes).
Tests: +3 regressions (empty/dup throw-like-vanilla, forced-root parity,
seed-survives-rebind). 638 tests / 1810 assertions green; Pint + docs build clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments