Skip to content

Clear core request state from the plugin instead of relying on core reset methods - #1

Merged
austinderrick merged 1 commit into
mainfrom
feat/absorb-core-resets
Oct 15, 2026
Merged

austinderrick merged 1 commit into
mainfrom
feat/absorb-core-resets

Conversation

@austinderrick

@austinderrick austinderrick commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

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_STATE lists 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 join STATIC_CACHES, and the Halcyon in-memory cache is flushed on every store the cache manager has resolved.
  • ResolveAuthIpAddress runs at the end of the global middleware stack and records each request's client address on the auth manager, after the trusted-proxy middleware.
  • The ResetsWorkerState contract moves to Winter\Octane\Contracts.
  • Registration checks only that Storm dispatches interface listeners. boot() logs a warning when a worker has no back-end navigation, which happens on a Winter without #1511.
  • The auth reset also turns sessions back on, which covers a Storm without Restore session use in Auth\Manager::once() when authentication throws storm#261.

A review by five reviewers (GPT, Grok, Gemini and two Claude reviewers) found more state that survived the reset. The second commit fixes it:

  • Storm's database query cache (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 and MediaViewHelper's player partial flags are reset.
  • Every resolved Storm auth manager is reset and gets the client address, which covers front-end managers such as Winter.User's as well as the back-end one.
  • An abandoned transaction and a failed rollback are now logged.
  • When Storm cannot dispatch interface listeners, a worker fails to start with the reason, and PHP-FPM no longer logs a warning on every request.
  • The boot warning looks for core's own navigation callback, so a plugin's callback cannot hide a missing Register back-end navigation, widgets and settings in a Laravel Octane worker winter#1511.

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_STATE property across requests, a failed rollback, and the boot warning; each fails without its change. The manifest tests also check MANAGER_STATE reset values against the declared defaults. The test for the PreferenceMaker cache key was removed with that core change, since the trait static reset test already covers the cache.

…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.
@austinderrick
austinderrick merged commit 040343a into main Oct 15, 2026
2 checks passed
@austinderrick
austinderrick deleted the feat/absorb-core-resets branch October 15, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant