Skip to content

Middleware chain timeout #88

@MR-MKZ

Description

@MR-MKZ

Describe the bug
Middleware chain timeout which is a new feature in Axon has some bugs for responding to user and blocking the chain.

Axon v0.11.0

To Reproduce
route with this settings:

middleware(sampleMiddleware.helloWorld, 100, true);

tested middlewares:

const helloWorld: Middleware = async (req, res, next) => {
    for (let i = 0; i < 1000000; i++) {
        console.log("middleware: Hello, World!");
    }
}

const helloWorld: Middleware = async (req, res, next) => {
    for (let i = 0; i < 1000000; i++) {
        console.log("middleware: Hello, World!");
    }
    next();
}

const helloWorld: Middleware = async (req, res, next) => {
    next();
    for (let i = 0; i < 1000000; i++) {
        console.log("middleware: Hello, World!");
    }
}

Screenshots

Image

Image

Image

Image

Metadata

Metadata

Assignees

Labels

Bug 🪲Something isn't working

Type

Projects

Status

Ready

Relationships

None yet

Development

No branches or pull requests

Issue actions