Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

KernelEvents::TERMINATE will dispatch twice after push HttpCache to stack #10

Closed

Description

@thbourlove
No description provided.

Activity

  1. igorw commented on Nov 19, 2014

    @igorw
    Contributor

    First of all, thanks so much for reporting this!

    This highlights a pretty interesting flaw in the current design of the stack. The stack assumes that every middleware will handle its own layer of termination. The stack just triggers every terminate() individually. However, this is not the case. Since a middleware is a decorator, if it implements terminate(), it will of course also call terminate() on the next layer!

    As a result, it will be called once by stack, and once by the cache middleware itself.

    The reason for doing this in the first place, is that terminable is optional. So because not every middleware of the chain has to implement it, the chain can be broken. The point of the stack is to never break this chain, and call all of the terminable middlewares.

    I have some ideas for fixing the problem, but it is going to get a bit complicated.

  2. igorw commented on Nov 19, 2014

    @igorw
    Contributor

    It's... complicated.

  3. added 2 commits that reference this issue on Nov 19, 2014
    acea575
    17887ec
  4. igorw commented on Nov 23, 2014

    @igorw
    Contributor

    This issue has been fixed in v1.0.3, thanks so much for reporting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions