Closed ClaraLeigh closed 1 year ago
essentially runs the ControllerDecorator again. This is not ideal but works for now.
Hi there, thank you for tackling this issue but could we solve this differently? I don't think running something twice can be an option.
@lorisleiva yea I would like to but the reason for putting everything here is the hope that someone might work out what the real problem is. A bit low on time to dig into it further at this time
Description
When using octane, I found that subsequent requests would often fail, with two different errors showing:
From these errors, I can determine that route binding and dependancy injection is breaking on occasion. As such we need to ensure that we are resolving the arguments correctly before calling the handle() method.
Changes Made
File
src/Concerns/AsController.php
File
src/Decorators/ControllerDecorator.php
execute
method to call the default run functionIssues remaining
I feel like there is a double up now, that ControllerDecorator runs twice as it seems to resolve things like jsonResponse and htmlResponse. This is why the new
execute
function usesrun
and notcallAction
or__invoke
Testing - needs work
This needs to be tested in a replicable octane environment, for the moment I tested by manually disabling the call to
replaceRouteMethod
in the decorator's constructor and then updating theAsController::__invoke
method to look like so:This would then cause the default
AsController::__invoke
function to run first, first like it does in subsequent Octane callsRelated Issues