63763[TASK] Introduce ServerRequestInstruction handling
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 4
- typo3/sysext/core/Classes/Http/AbstractApplication.php+10 −4
- typo3/sysext/core/Classes/Http/ServerRequestInstructionAwareInterface.phpnew+24 −0
- typo3/sysext/core/Classes/Http/ServerRequestInstructionInterface.phpnew+33 −0
- typo3/sysext/core/Documentation/Changelog/9.5.x/Important-90778-IntroduceServerRequestInstructionHandling.rstnew+93 −0
Review log 2537
Show 612 earlier messages
-
Oliver Hader uploaded patch set 1 03/18/20, 12:40
-
TYPO3com voted on patch set 1 V -1 03/18/20, 12:40 Completed build in 24s on Wed, 18 Mar, 12:40 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1414
-
Oliver Hader uploaded patch set 2 03/18/20, 13:07
-
TYPO3com voted on patch set 2 V -1 03/18/20, 13:19 Completed build in 11m 05s on Wed, 18 Mar, 01:19 PM Test Summary: 21 of 72523 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1416
-
TYPO3com commented on patch set 2 03/18/20, 13:49 Completed build in 52m 39s on Wed, 18 Mar, 01:49 PM Test Summary: 21 of 72523 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1416
-
Andreas Kienast commented on patch set 2 CR -1 03/19/20, 06:37
on it -
Andreas Kienast uploaded patch set 3 03/19/20, 06:45
-
TYPO3com voted on patch set 3 V -1 03/19/20, 06:57 Completed build in 12m 01s on Thu, 19 Mar, 06:57 AM Test Summary: 21 of 72561 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1424
-
Oliver Hader rebased onto patch set 4 03/19/20, 20:40
-
Oliver Hader uploaded patch set 5 03/19/20, 20:42
-
TYPO3com voted on patch set 4 V -1 03/19/20, 20:57 Completed build in 15m 47s on Thu, 19 Mar, 08:57 PM Test Summary: 15 of 72601 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1473
-
TYPO3com voted on patch set 5 V -1 03/19/20, 21:02 Completed build in 14m 56s on Thu, 19 Mar, 09:02 PM Test Summary: 15 of 72601 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1474
-
Oliver Hader uploaded patch set 6 03/20/20, 16:34
-
Oliver Hader commented on patch set 6 03/20/20, 16:35
@AndreasFernandez: Sorry, I totally overlooked your changes. Thanks for the new template, that looks much better than mine! :) -
TYPO3com voted on patch set 6 V -1 03/20/20, 16:51 Completed build in 16m 33s on Fri, 20 Mar, 04:51 PM Test Summary: 15 of 72610 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1515
-
Oliver Hader marked it work in progress 03/28/20, 08:43
-
Oliver Hader uploaded patch set 7 03/28/20, 11:27
-
Oliver Hader uploaded patch set 8 03/28/20, 11:40
-
TYPO3com voted on patch set 7 V +1 03/28/20, 11:48 Completed build in 21m 28s on Sat, 28 Mar, 11:48 AM Test Summary: 73044 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1892
-
TYPO3com voted on patch set 8 V -1 03/28/20, 11:56 Completed build in 15m 52s on Sat, 28 Mar, 11:56 AM Test Summary: 2 of 73522 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1893
-
TYPO3com voted on patch set 8 V +1 03/29/20, 10:03 Completed build in 22h 39m 07s on Sun, 29 Mar, 10:03 AM Test Summary: 73042 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1893
-
Markus Klein commented on patch set 8 03/29/20, 21:06
ServerRequestInstructionException.php:32So we replace the constructor and we ignore the message an exception typically has? I'm not entirely convinced this is a good idea. -
Alexander Schnitzler commented on patch set 8 03/30/20, 08:15
Do you have an example that outlines how such an instruction set looks like? -
Alexander Schnitzler commented on patch set 8 03/30/20, 08:23
There is another question I have. PSR-15 says, that it is recommended to have a middleware as first executed component which handles all Exceptions that occur during the processing of the request. I fear that this concept contradicts the idea of having such a component. What about implementing such a component and create a specific response that indicates the re-dispatching of a modified request instead? -
Alexander Schnitzler commented on patch set 8 03/30/20, 08:24
> Patch Set 8: > > There is another question I have. PSR-15 says, that it is recommended to have a middleware as first executed component which handles all Exceptions that occur during the processing of the request. > > I fear that this concept contradicts the idea of having such a component. What about implementing such a component and create a specific response that indicates the re-dispatching of a modified request instead? link: https://www.php-fig.org/psr/psr-15/#14-handling-exceptions -
Oliver Hader commented on patch set 8 03/30/20, 09:08
ServerRequestInstructionException.php:32Reply UnresolvedThis exception shall be used to stop current execution, and restart processing, similar to `ImmediateResponseException` (but for the request this time). I agree that ignoring parent constructor of an exception is not a "clean" solution, so basically I see your point here. I might be playing around with Throwable instead... -
Oliver Hader commented on patch set 8 03/30/20, 09:10
> Patch Set 8: > > Do you have an example that outlines how such an instruction set looks like? For instance like this https://github.com/FriendsOfTYPO3/sudo-mode/blob/master/Classes/Http/ServerRequestInstruction.php (since this is marked as WIP, proper documentation in an "important.rst" file is still missing - but feedback is welcome of course) -
Oliver Hader commented on patch set 8 03/30/20, 09:17
> Patch Set 8: > > > Patch Set 8: > > > > There is another question I have. PSR-15 says, that it is recommended to have a middleware as first executed component which handles all Exceptions that occur during the processing of the request. > > > > I fear that this concept contradicts the idea of having such a component. What about implementing such a component and create a specific response that indicates the re-dispatching of a modified request instead? > > link: https://www.php-fig.org/psr/psr-15/#14-handling-exceptions Probably that response would meet the recommendation(!) in PSR-15, however it would * lead to hard-coded handling of that response (or it's interface) * continue superfluous processing in other middlewares So basically the ServerRequestInstruction could be seen as a redirect, however with a potential change in the HTTP method and their body - which is (to my knowledge) not possible with HTTP. -
Oliver Hader uploaded patch set 9 03/30/20, 13:57
-
Oliver Hader commented on patch set 9 03/30/20, 14:01
@AlexSchnitzler: I followed your suggestion using a dedicated Response object in order to avoid exceptions. What do you think about this adjustment? I've adjusted the implementation at https://github.com/FriendsOfTYPO3/sudo-mode/tree/master/Classes/Http as well. -
TYPO3com voted on patch set 9 V -1 03/30/20, 14:09 Completed build in 11m 14s on Mon, 30 Mar, 02:09 PM Test Summary: 13 of 73543 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1966
-
TYPO3com voted on patch set 9 V +1 03/30/20, 14:31 Completed build in 44m 37s on Mon, 30 Mar, 02:31 PM Test Summary: 73056 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1966
-
Alexander Schnitzler commented on patch set 9 03/30/20, 16:46
> Patch Set 8: > > > Patch Set 8: > > > > > Patch Set 8: > > > > > > There is another question I have. PSR-15 says, that it is recommended to have a middleware as first executed component which handles all Exceptions that occur during the processing of the request. > > > > > > I fear that this concept contradicts the idea of having such a component. What about implementing such a component and create a specific response that indicates the re-dispatching of a modified request instead? > > > > link: https://www.php-fig.org/psr/psr-15/#14-handling-exceptions > > Probably that response would meet the recommendation(!) in PSR-15, however it would > * lead to hard-coded handling of that response (or it's interface) > * continue superfluous processing in other middlewares > > So basically the ServerRequestInstruction could be seen as a redirect, however with a potential change in the HTTP method and their body - which is (to my knowledge) not possible with HTTP. I am not sure we are on the same side here. If I understand PSR-15 correctly it's recommended to have a a component as first middleware that catches all exceptions and adjusts the responses accordingly. That way, whenever there is an Exception in the stack, you fall back to the most inner component. What you write reads a bit differently. Especially the superfluous processing of further middlewares. That means, we wouldn't throw an Exception, right? What I had in mind was: * Throwing that Exception like in your original PS. * Implementing that very first component that possibly catches this Exception (and others in the future like ImmediateResponseException) and returns a specific response based on the Exception. * Handling that response as you do in your latest PS. btw: this PS seems to miss that response you have on Github or do I overlook something here? -
Oliver Hader commented on patch set 9 03/30/20, 18:53
> Patch Set 9: > > > Patch Set 8: > > > > > Patch Set 8: > > > > > > > Patch Set 8: > > > > > > > > There is another question I have. PSR-15 says, that it is recommended to have a middleware as first executed component which handles all Exceptions that occur during the processing of the request. > > > > > > > > I fear that this concept contradicts the idea of having such a component. What about implementing such a component and create a specific response that indicates the re-dispatching of a modified request instead? > > > > > > link: https://www.php-fig.org/psr/psr-15/#14-handling-exceptions > > > > Probably that response would meet the recommendation(!) in PSR-15, however it would > > * lead to hard-coded handling of that response (or it's interface) > > * continue superfluous processing in other middlewares > > > > So basically the ServerRequestInstruction could be seen as a redirect, however with a potential change in the HTTP method and their body - which is (to my knowledge) not possible with HTTP. > > I am not sure we are on the same side here. If I understand PSR-15 correctly it's recommended to have a a component as first middleware that catches all exceptions and adjusts the responses accordingly. That way, whenever there is an Exception in the stack, you fall back to the most inner component. What you write reads a bit differently. Especially the superfluous processing of further middlewares. That means, we wouldn't throw an Exception, right? > > What I had in mind was: > > * Throwing that Exception like in your original PS. > * Implementing that very first component that possibly catches this Exception (and others in the future like ImmediateResponseException) and returns a specific response based on the Exception. > * Handling that response as you do in your latest PS. > > btw: this PS seems to miss that response you have on Github or do I overlook something here? Indeed I did understand your mention of "such a component" in a different way and thought it's related to PS back then - I was not aware that it was referring to something that does not exist yet. Basically I understood now "move the logic that is currently in AbstractApplication to a new middleware handler, always being the first to be called in the whole middleware stack". Correct? -
Alexander Schnitzler commented on patch set 9 03/30/20, 19:45
> Patch Set 9: > > > Patch Set 9: > > > > > Patch Set 8: > > > > > > > Patch Set 8: > > > > > > > > > Patch Set 8: > > > > > > > > > > There is another question I have. PSR-15 says, that it is recommended to have a middleware as first executed component which handles all Exceptions that occur during the processing of the request. > > > > > > > > > > I fear that this concept contradicts the idea of having such a component. What about implementing such a component and create a specific response that indicates the re-dispatching of a modified request instead? > > > > > > > > link: https://www.php-fig.org/psr/psr-15/#14-handling-exceptions > > > > > > Probably that response would meet the recommendation(!) in PSR-15, however it would > > > * lead to hard-coded handling of that response (or it's interface) > > > * continue superfluous processing in other middlewares > > > > > > So basically the ServerRequestInstruction could be seen as a redirect, however with a potential change in the HTTP method and their body - which is (to my knowledge) not possible with HTTP. > > > > I am not sure we are on the same side here. If I understand PSR-15 correctly it's recommended to have a a component as first middleware that catches all exceptions and adjusts the responses accordingly. That way, whenever there is an Exception in the stack, you fall back to the most inner component. What you write reads a bit differently. Especially the superfluous processing of further middlewares. That means, we wouldn't throw an Exception, right? > > > > What I had in mind was: > > > > * Throwing that Exception like in your original PS. > > * Implementing that very first component that possibly catches this Exception (and others in the future like ImmediateResponseException) and returns a specific response based on the Exception. > > * Handling that response as you do in your latest PS. > > > > btw: this PS seems to miss that response you have on Github or do I overlook something here? > > Indeed I did understand your mention of "such a component" in a different way and thought it's related to PS back then - I was not aware that it was referring to something that does not exist yet. > > Basically I understood now "move the logic that is currently in AbstractApplication to a new middleware handler, always being the first to be called in the whole middleware stack". Correct? Yes, however that's just an idea. Don't know of you can reach your goal that way but from what I understand the way the PSR recommends fits our needs/ideas. -
Oliver Hader abandoned the change 03/30/20, 20:16
Moved logic to application specific layer (https://github.com/FriendsOfTYPO3/sudo-mode/blob/master/Classes/Middleware/RequestHandlerGuard.php) Closing this PS - restructuring middleware handling in a generic way probably involves more aspects and should be covered with corresponding tests as well... -
Oliver Hader commented on patch set 9 03/30/20, 20:19
@AlexSchnitzler: Moving the individual exception handling to a first middleware was a good suggestion - I did not consider that all. So, thanks for this nice suggestion! +1