• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Warning: This build has drifted.
The coverage report for this pull request build may be inaccurate because its base commit is no longer the HEAD of its target branch.
This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

    • Learn more: For more information on this, see Tracking coverage changes for pull request builds.
    • Fix now: For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
    • Prevent going forward: To avoid this issue with future PRs, see these Recommended CI Configurations.
New Repo Setting:
INCLUDE COVERAGE % WITH WARNINGS ABOUT DRIFTED BUILDS?

Enabling this setting will include a (potentially inaccurate) coverage % with warning messages in status updates for drifted builds.

Adjust setting

supabase / auth / 17658685860
68%
master: 69%

Build:
Build:
LAST BUILD BRANCH: feat/add-email-metrics
DEFAULT BRANCH: master
Ran 11 Sep 2025 10:23PM UTC
Jobs 1
Files 163
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

11 Sep 2025 10:15PM UTC coverage: 67.645% (-3.0%) from 70.664%
17658685860

Pull #2148

github

web-flow
feat: background template reloading p2 - mailer template cache & interface refactor (#2150)

**Summary**
This PR builds on
[auth#2148](https://github.com/supabase/auth/pull/2148) to deliver phase
2, a robust template cache plus a simplified mail client interface.
Templates are now rendered once per type, cached with controlled
refresh, and then delivered via clients that only send pre-rendered
subject/body. This reduces latency and removes templating logic from
SMTP clients while preserving current behavior. It will also pave the
way for alternative Mailer implementations.

**Template cache + interface refactor**
* Replace `TemplateMailer` with `templatemailer.Mailer` that owns all
templating and a shared cache. Entries have a TTL and a shorter “recheck
interval”; on fetch/parse errors we serve the last good or fall back to
built-in defaults.
* Centralize default subjects/bodies and validate them at init. Typed
template keys are: `invite`, `confirmation, recovery`, `email_change`,
`magic_link`, `reauthentication`.
* Move headers logic into the mailer; keep `$messageType` substitution
and the legacy “reauthenticate” header name for compatibility.
* Change `mailer.Client.Mail` to `(ctx, to, subject, body, headers,
typ)` and update all clients accordingly (SMTP/Noop/Validate/Tasks).
* Persist a single mailer instance in `API`; add `WithMailer` for DI;
remove on-demand construction.

---------

Co-authored-by: Chris Stockton <chris.stockton@supabase.io>
Pull Request #2148: feat: background template reloading p1 - baseline decomposition

285 of 644 new or added lines in 10 files covered. (44.25%)

593 existing lines in 15 files now uncovered.

12745 of 18841 relevant lines covered (67.65%)

64.93 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
65.62
0.0% internal/api/mail.go
6
53.85
internal/mailer/noopclient/noopclient.go
6
90.08
internal/mailer/templatemailer/templatemailer.go
9
87.84
-3.83% internal/api/options.go
20
70.47
internal/mailer/validateclient/validateclient.go
23
17.86
internal/mailer/taskclient/taskclient.go
44
0.0
internal/mailer/mailmeclient/mailmeclient.go
57
0.0
internal/api/apiworker/apiworker.go
193
49.74
internal/mailer/templatemailer/template.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
90.24
0.0% internal/hooks/v0hooks/v0hooks.go
9
65.11
1.17% internal/api/token.go
14
79.49
3.93% internal/models/flow_state.go
16
86.22
0.83% internal/api/api.go
17
78.33
0.0% internal/models/sessions.go
19
45.83
-1.31% internal/models/errors.go
20
66.32
-1.08% internal/models/refresh_token.go
21
76.35
-0.92% internal/api/context.go
21
75.7
-9.72% internal/models/oauth_client.go
24
82.55
-5.6% internal/api/oauthserver/service.go
30
0.0
-41.38% internal/api/oauthserver/auth.go
51
63.04
-0.93% internal/models/factor.go
60
75.99
-3.68% internal/api/middleware.go
81
73.98
-1.37% internal/tokens/service.go
208
31.02
-46.85% internal/api/oauthserver/handlers.go
Jobs
ID Job ID Ran Files Coverage
1 17658685860.1 11 Sep 2025 10:23PM UTC 163
67.65
GitHub Action Run
Source Files on build 17658685860
  • Tree
  • List 163
  • Changed 20
  • Source Changed 0
  • Coverage Changed 20
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #2148
  • PR Base - master (#17297186832)
  • Delete
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