Repository navigation
Conversation
gr8man
force-pushed
the
fix/worker-hostname-routes
branch
from
November 20, 2026 23:22
a03f94e to
367870d
Compare
michalsn
requested changes
Nov 21, 2026
- Remove the duplicated routes explanation from the Config\WorkerMode::$persistentServices docblock. - Drop the Behavior Changes section from the 4.7.7 upgrade guide. - Shorten the Config bullet and link it to Persistent Services instead. - Move the route reload bullet after the request state reset and drop an unmeasured cost claim in worker_mode.md. - Retarget the 4.7.7 changelog Worker Mode link to Persistent Services.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
In Worker Mode,
RouteCollectiondecides route registration while it loads the route definitions: it reads the request host once (system/Router/RouteCollection.php:285) and drops the routes limited with thehostnameorsubdomainoptions that do not match the current request (:1347-1361). Because the shippedConfig\WorkerMode::$persistentServiceskept theroutesservice alive across requests, those decisions were made once, from the first request the worker served, and kept for the lifetime of the process: a host-restricted route became reachable from anyHost, and a route that lost the first decision stayed unreachable until the worker restarted.This removes
routesfrom the default$persistentServices, so the route definitions are loaded for each request and the host is evaluated per request - identical to traditional PHP.Design note: the deeper fix - enforcing the host at route-match time, the way filters work - cannot land in a patch release: route storage is keyed by URI path only, so the documented same-URI-on-two-hosts case would collide. That redesign belongs to a minor release. The accepted cost of this change is that the routes file is re-read per request - a small, documented amount of work compared with what Worker Mode already eliminates.
Tests and docs: a regression test asserts the shipped default no longer persists
routes(it fails without the change). Updated: the user guide (docs/installation/worker_mode.md), an upgrading note for existing installations (docs/installation/upgrade_477.md, "Worker Mode Routes Are Reloaded Per Request", plus the project-file content change entry), and one changelog line under "Bugs Fixed". The worker entry-point template needs no change. Full CI matrix left to GitHub Actions.Note for reviewers: this flips a documented default on the patch line (removing
routesfrom$persistentServicesin project space). It is shipped as a correctness fix for thehostname/subdomainroute options in Worker Mode, with changelog and upgrading entries; maintainer confirmation of the default change is requested. Existing installations keep the old default until they merge the updated file.Checklist:
WorkerModedocblock now documents whyroutesis not persistent)docs/installation/worker_mode.md; upgrading note indocs/installation/upgrade_477.md)