Repository navigation
Clear core request state from the plugin instead of relying on core reset methods - #1
Merged
Merged
Conversation
…eset methods The core PRs were reduced to the changes a plugin cannot make (wintercms/winter#1511 and wintercms/storm#241), so the plugin now clears the manager, auth, error mask and Halcyon state itself: - MANAGER_STATE lists the request-derived properties on the navigation, widget, settings, mail, component and back-end auth managers, cleared by reflection. - ErrorHandler's masks join STATIC_CACHES, and the Halcyon in-memory cache is flushed on every resolved store. - ResolveAuthIpAddress records the client address on the auth manager after the trusted-proxy middleware. - The ResetsWorkerState contract moves to Winter\Octane\Contracts. - Registration now checks only that Storm dispatches interface listeners, and boot() logs a warning when a worker has no back-end navigation (Winter without #1511). - The auth reset also turns sessions back on, covering Storm without the once() fix.
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.
Summary
The core PRs were reduced to the changes a plugin cannot make: wintercms/winter#1511 (back-end registration in a worker) and wintercms/storm#241 (interface event listeners). The resets that core used to provide now live here.
MANAGER_STATElists the request-derived properties on the navigation, widget, settings, mail, component and back-end auth managers, and the reset clears them by reflection. The manifest test fails if core renames one.ErrorHandler's masks joinSTATIC_CACHES, and the Halcyon in-memory cache is flushed on every store the cache manager has resolved.ResolveAuthIpAddressruns at the end of the global middleware stack and records each request's client address on the auth manager, after the trusted-proxy middleware.ResetsWorkerStatecontract moves toWinter\Octane\Contracts.boot()logs a warning when a worker has no back-end navigation, which happens on a Winter without #1511.A review by five reviewers (GPT, Grok, Gemini and two Claude reviewers) found more state that survived the reset. The second commit fixes it:
MemoryCache) is now flushed every operation. Writes from other workers never invalidated it, so a worker kept serving cached rows, including a signed-out back-end user's persist code.CmsCompoundObject's component property map andMediaViewHelper's player partial flags are reset.The bug fixes split out of the core PRs, plus two found in review (wintercms/winter#1570 and #1571), are listed in the README under "Related core fixes".
Testing
48 tests pass against the two trimmed core branches. New tests cover the client address on every auth manager, the Halcyon cache, every
MANAGER_STATEproperty across requests, a failed rollback, and the boot warning; each fails without its change. The manifest tests also checkMANAGER_STATEreset values against the declared defaults. The test for thePreferenceMakercache key was removed with that core change, since the trait static reset test already covers the cache.