Zenika / feedzback

Request and give feedback to your colleagues
https://feedzback.znk.io/
10 stars 2 forks source link

server(fix): critical auth service scope #691

Closed avine closed 2 weeks ago

avine commented 2 weeks ago

This is a critical fix!

The problem

The AuthService was not scoped to each incoming request.

This meant that if the server had to process requests from different connected users in parallel (nearly at the same time), the result was unpredictable.

auth-service-problem

Fortunately, the problem probably never occurred, as the application's traffic remains limited.

auth-service-ok

The solution

From now on, an instance of the AuthService is created for each incoming request.

Learn more about the implementation of the solution : https://docs.nestjs.com/fundamentals/injection-scopes