fix(auth-server): safely access metrics methods in redis#19934
fix(auth-server): safely access metrics methods in redis#19934sreecharan-desu wants to merge 2 commits intomozilla:mainfrom
Conversation
5ba5528 to
31782fe
Compare
Thank you for this contribution! We'd like to request that the mocks are fixed instead of using optional chaining. Although |
|
Thanks for the feedback! Reverted the optional chaining on methods and fixed the mock injection in instead. this.metrics is now properly instantiated with mocks. |
afd08ad to
8aa82a2
Compare
|
Tests for Redis metrics implementation are passing locally with Docker: |
Fixes #16491. This PR updates the Redis wrapper in to safely access metrics methods (, ) using optional chaining (). This prevents crashes (e.g., ) when the metrics object is undefined or mocked incompletely, such as in certain test environments or when metrics are disabled via configuration.