When we cache user documents by ID, we use a key based on an object like { filter: { _id: "ObjectId" } }

Then, during the login request, we attempt to invalidate the cached user by calling BaseRepository.invalidateCacheById, which internally triggers invalidateCacheByFilterId asynchronously.


As a result, in some cases, the next request in the test scenario might be executed before invalidateCacheByFilterId has completed. This leads to the user being retrieved from the cache instead of the database, causing the Unauthorized issue reported by many CI/CD executions โ specifically, the cached user does not contain the token returned during login.

Please authenticate to join the conversation.
Completed
Bug & Fixes
10 months ago

Ivan Ligotino
Get notified by email when there are changes.
Completed
Bug & Fixes
10 months ago

Ivan Ligotino
Get notified by email when there are changes.