fix(api-service): Idempotency cache key user API fixes NV-7060#9845
fix(api-service): Idempotency cache key user API fixes NV-7060#9845
Conversation
|
Cursor Agent can help with this pull request. Just |
✅ Deploy Preview for dashboard-v2-novu-staging canceled.
|
The /v1/widgets/session/initialize endpoint doesn't have authenticated user context, which causes InternalServerErrorException when idempotency interceptor tries to build cache key. Added @ExcludeFromIdempotency() decorator to the sessionInitialize method. Fixes NV-7060 Co-authored-by: dima <dima@novu.co>
5753641 to
dcfcf2d
Compare
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What changed? Why was the change needed?
This PR resolves the
InternalServerErrorException: Cannot build idempotency cache key without user(NV-7060, Sentry Issue: API-HM).The
IdempotencyInterceptor.isEnabled()method incorrectly returnedtruewhen the authentication scheme was notAPI_KEY, leading togetCacheKey()being called without a user.The changes include:
isEnabled()logic to returnfalsewhen the auth scheme is not allowed, preventing idempotency from being enabled for non-API_KEY requests.isEnabled()andintercept()methods to gracefully skip idempotency if a user is not present, preventing theInternalServerErrorException.Linear Issue: NV-7060