Skip to content

Make send-notification best effort - #701

Open
jakub-id wants to merge 1 commit into
mainfrom
send-notification-best-effort
Open

Make send-notification best effort#701
jakub-id wants to merge 1 commit into
mainfrom
send-notification-best-effort

Conversation

@jakub-id

@jakub-id jakub-id commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings August 3, 2026 14:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the patron-request send-notification action “best effort” by preventing email delivery problems (or email service unavailability) from failing the overall action execution, while updating unit tests to reflect the new success semantics.

Changes:

  • Treat email notification failures and “email service not ready” as EventStatusSuccess, returning a note instead of an error status.
  • Introduce a helper to centralize “log + return success” behavior for notification errors.
  • Update TestSendEmailNotification expectations from error results to success + note.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
broker/patron_request/service/action.go Switch notification error handling to “log and return success” via a shared helper.
broker/patron_request/service/action_test.go Update notification tests to assert success status and result.Note instead of error status.

Comment on lines +1091 to 1098
func logNotificationErrorAndReturnSuccess(ctx common.ExtendedContext, pr pr_db.PatronRequest, msg string, err error) actionExecutionResult {
ctx.Logger().Error(msg, "error", err)
return actionExecutionResult{
status: events.EventStatusSuccess,
result: &events.EventResult{CommonEventData: events.CommonEventData{Note: msg}},
pr: pr,
}
}
Comment on lines 706 to 710
func (a *PatronRequestActionService) sendNotificationBorrowingRequest(ctx common.ExtendedContext, pr pr_db.PatronRequest, params actionParams) actionExecutionResult {
if !a.emailService.IsReadyToSend() {
return actionExecutionResult{status: events.EventStatusSuccess, result: &events.EventResult{CommonEventData: events.CommonEventData{Note: "email service is not ready to send"}}, pr: pr}
return logNotificationErrorAndReturnSuccess(ctx, pr, "email service is not ready to send", nil)
}
return a.sendEmailNotification(ctx, pr, params, pr.RequesterSymbol.String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants