[PR #2069] [MERGED] fix(mail): disable queue when mailer disabled #3908

Closed
opened 2026-03-22 14:56:45 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2069
Author: @kolaente
Created: 1/8/2026
Status: Merged
Merged: 1/8/2026
Merged by: @kolaente

Base: mainHead: feat/disable-mail-queue-when-mailer-disabled


📝 Commits (1)

  • f1b8b03 fix(mail): disable queue when mailer disabled

📊 Changes

3 files changed (+66 additions, -2 deletions)

View changed files

📝 pkg/mail/mail.go (+3 -2)
📝 pkg/mail/send_mail.go (+4 -0)
pkg/notifications/notify_disabled_test.go (+59 -0)

📄 Description

Summary

  • Don't create the mail queue when the mailer is disabled to prevent SendMail() from blocking indefinitely
  • Add guard clause in SendMail() to return early when mailer is disabled or queue is nil
  • Add test to verify notifications don't block when mailer is disabled

This implements the changes from #1080 with the review feedback addressed (using package notifications instead of package notifications_test).

Test plan

  • Run mage test:filter TestNotifyDoesNotBlockWhenMailerDisabled - passes
  • Run mage test:filter TestNotify - all notification tests pass
  • Run mage lint - 0 issues

Closes #1080


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2069 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 1/8/2026 **Status:** ✅ Merged **Merged:** 1/8/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `feat/disable-mail-queue-when-mailer-disabled` --- ### 📝 Commits (1) - [`f1b8b03`](https://github.com/go-vikunja/vikunja/commit/f1b8b03161c2c26172631a594e8d9c6eabbf002f) fix(mail): disable queue when mailer disabled ### 📊 Changes **3 files changed** (+66 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `pkg/mail/mail.go` (+3 -2) 📝 `pkg/mail/send_mail.go` (+4 -0) ➕ `pkg/notifications/notify_disabled_test.go` (+59 -0) </details> ### 📄 Description ## Summary - Don't create the mail queue when the mailer is disabled to prevent `SendMail()` from blocking indefinitely - Add guard clause in `SendMail()` to return early when mailer is disabled or queue is nil - Add test to verify notifications don't block when mailer is disabled This implements the changes from #1080 with the review feedback addressed (using `package notifications` instead of `package notifications_test`). ## Test plan - [x] Run `mage test:filter TestNotifyDoesNotBlockWhenMailerDisabled` - passes - [x] Run `mage test:filter TestNotify` - all notification tests pass - [x] Run `mage lint` - 0 issues Closes #1080 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 14:56:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#3908