nestjs icon indicating copy to clipboard operation
nestjs copied to clipboard

Is middleware woking?

Open stPitty opened this issue 3 years ago • 1 comments

Im using async configuration and want to use session:

createGrammyOptions(): GrammyModuleOptions {
    return {
      token: myToken,
      middlewares: [session({ initial: () => ({ pizzaCount: 0 }) })],
    };
  }
}

Use this in app.module for import:

NestjsGrammyModule.forRootAsync({
  useClass: GrammyConfigService,
}),

But its not working. I had tried create custom middleware and it still didnt work. I just catch nothing in ctx: image

stPitty avatar Nov 02 '22 21:11 stPitty

Is this a question or a bug report? Either way, you need to elaborate what you mean by “not working.”

KnorpelSenf avatar Nov 05 '22 15:11 KnorpelSenf

No, they're not working. For some reason, line for register middlewares from options were just deleted and now that useless field... https://github.com/grammyjs/nestjs/commit/93d8f8335b567979d0a5729d50dff07df36f0ee1#diff-cb28a0c29c88963748f1d370d740da14e5bbf732bd912ab8b34dca8a686d1acd

Morb0 avatar Dec 18 '22 11:12 Morb0

@drmikecrowe and @solidprinciples who maintain this repo are both relatively inactive at the time. Feel free to fix things up and help getting this project back on track, until hopefully they return.

KnorpelSenf avatar Dec 18 '22 14:12 KnorpelSenf

PR #33 should fix this. One published, consuming version 0.3.3 should fix your issue.

solidprinciples avatar Jan 08 '23 20:01 solidprinciples