Skip to content

Bugfix: Run deferred callbacks in HTTP requests - #260

Merged
LukeTowers merged 2 commits into
wintercms:wip/1.3from
austinderrick:fix/invoke-deferred-callbacks
Oct 10, 2026
Merged

LukeTowers merged 2 commits into
wintercms:wip/1.3from
austinderrick:fix/invoke-deferred-callbacks

Conversation

@austinderrick

@austinderrick austinderrick commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

defer() callbacks never run in web requests. Laravel runs them from the InvokeDeferredCallbacks middleware, which new Laravel apps get by default. Winter's HTTP kernel defines its own middleware list and doesn't include it, so the callbacks are silently dropped. This also breaks Cache::flexible(), Concurrency::defer(), and the deferred and background queue connections.

This PR adds the middleware to the kernel, in the same position Laravel uses, and adds a test that fails without the fix.

It also cherry-picks 6050387 from develop (enshrined/svg-sanitize ~1.0), since wip/1.3 doesn't install without it.

Add Laravel's InvokeDeferredCallbacks middleware to the HTTP kernel so
callbacks registered with defer() run after the response is sent.
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ebc87fe2-1214-4116-8c11-80f29cc7b5d5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@austinderrick austinderrick changed the title Run deferred callbacks in HTTP requests Bugfix: Run deferred callbacks in HTTP requests Oct 10, 2026
@LukeTowers
LukeTowers merged commit efbba4f into wintercms:wip/1.3 Oct 10, 2026
10 checks passed
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.

2 participants