• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vocdoni / saas-backend / 27433838527
60%
main: 60%

Build:
Build:
LAST BUILD BRANCH: f/new_org_bundles_endpoint
DEFAULT BRANCH: main
Ran 12 Jun 2026 06:09PM UTC
Jobs 1
Files 94
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Jun 2026 06:03PM UTC coverage: 60.26% (+0.2%) from 60.094%
27433838527

Pull #520

github

altergui
refactor(notifications): unify queue infrastructure and OTP lifecycle constants

Move the circuit-breaker and queue mechanics out of csp/notifications/ into the
top-level notifications/ package as generic, reusable types (Breaker, Queue,
QueueItem). The CSP queue becomes a thin wrapper that maps NotificationChallenge
↔ QueueItem via a Meta field and feeds NotificationsSent from the inner Done
channel — external interface unchanged.

Wire a notifications.Queue into api.API (created in New, started in Start).
Rewrite sendMail to enqueue asynchronously instead of blocking the request
goroutine on SendNotification. Add a queueNotification helper for pre-built
notifications and use it in organizationCreateTicket, which was previously
calling a.mail.SendNotification directly (no retry, no circuit-breaker).

Add CreatedAt to db.UserVerification (set in SetVerificationCode) and use it in
recoverUserPasswordHandler to enforce a per-account OTP cooldown, matching the
rate-limiting intent of the CSP OTP system.

Unify OTP lifecycle constants into notifications/:
- DefaultOTPExpiry (15 min): shared validity window for all one-time codes
  (account verification, password reset, CSP OTP challenges). Replaces the
  accidental split between apicommon.VerificationCodeExpiration (10 min) and
  csp.DefaultNotificationTTL (5 min).
- DefaultOTPCooldown (60 s): shared anti-spam rate limit between notification
  requests, used by both API password recovery and CSP token generation.
- DefaultQueueTTL bumped to 20 min (must exceed DefaultOTPExpiry).

Drop apicommon.VerificationCodeExpiration and PasswordRecoveryCooldown as
mutable package-level vars. Move the values to api.API struct fields
(otpExpiry, otpCooldown), initialized from api.Config in New() with fallback
to the notifications defaults. Tests override via testAPI directly (same-package
access). Expose both as runtime-configurable flags --otpExpiry / --otpCooldown
(VOCDONI_OTPEXPIRY / VOCDONI_OTPCOOLDOWN), wired into... (continued)
Pull Request #520: refactor(notifications): unify API email sends with CSP queue infrastructure

278 of 349 new or added lines in 14 files covered. (79.66%)

4 existing lines in 2 files now uncovered.

8064 of 13382 relevant lines covered (60.26%)

43.14 hits per line

Uncovered Changes

Lines Coverage ∆ File
26
86.73
notifications/queue.go
11
39.07
-0.14% api/users.go
8
0.0
0.0% cmd/service/main.go
7
63.64
-6.36% api/notifications.go
6
91.0
-1.68% api/api.go
6
90.48
6.57% csp/notifications/queue.go
4
72.32
-0.1% api/organizations.go
2
78.95
2.02% csp/csp.go
1
65.96
0.29% csp/auth.go

Coverage Regressions

Lines Coverage ∆ File
3
81.25
-6.25% csp/notifications/challenge.go
1
63.64
-6.36% api/notifications.go
Jobs
ID Job ID Ran Files Coverage
1 27433838527.1 12 Jun 2026 06:09PM UTC 94
60.26
GitHub Action Run
Source Files on build 27433838527
  • Tree
  • List 94
  • Changed 12
  • Source Changed 0
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #520
  • PR Base - main (#27410631824)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc