Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0dcf5b66f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| DiscordMessageResponse response = discordWebhookSender.sendAndGetMessage( | ||
| webhookUrl, | ||
| buildMessage(type, applicantInfo) | ||
| ); | ||
| discordNotificationService.save(type, reviewId, response.channelId(), response.id()); |
There was a problem hiding this comment.
Isolate webhook failures from submission transactions
When the configured webhook times out, returns an error, or yields an empty response, sendAndGetMessage propagates an exception from this synchronous overload. Both ScoreService submission methods and MentorApplicationService.submitMentorApplication invoke it inside @Transactional methods, so a Discord outage now rolls back an otherwise valid user submission; the previous notifier was asynchronous and isolated notification errors. Handle the failure outside the business transaction while still persisting the message identifiers after a successful send.
Useful? React with 👍 / 👎.
| String url = REACTION_URL.formatted(channelId, messageId, encodedEmoji); | ||
| HttpHeaders headers = new HttpHeaders(); | ||
| headers.set("Authorization", "Bot " + botToken); | ||
| discordBotRestTemplate.exchange(url, HttpMethod.PUT, new HttpEntity<>(headers), Void.class); |
There was a problem hiding this comment.
Prevent reaction failures from rolling back reviews
If the bot token is absent or invalid, or Discord is unavailable, this exchange throws through DiscordNotifier.addReaction. The new calls occur before the transactional GPA, language-score, and mentor approval/rejection methods return, so the external reaction failure rolls back the actual review state and prevents administrators from completing reviews. Catch or defer this ancillary Discord operation so it cannot determine the database transaction outcome.
Useful? React with 👍 / 👎.
No description provided.