Skip to content

Race condition #12

@metacatdud

Description

@metacatdud

Hi,
I just found this. Niiice!
Looks like a good idea for a very clean, general purpose architecture. I took it for a drive test and I run into:
headers already send situation

The issue lies here:

public execute (req: express.Request, res: express.Response): void {
    this.req = req;
    this.res = res;
    this.executeImpl();
 }

If I convert

userRouter.post('/',
  (req, res) => createUserController.execute(req, res)
)

to

userRouter.post('/', async (req, res) => { 
     const createUserController = new CreateUserController(/useCaseGoesHere/)
     await createUserController.execute(req, res)
 })

it work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions