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

supabase / auth / 17277690859
69%

Build:
DEFAULT BRANCH: master
Ran 27 Aug 2025 08:23PM UTC
Jobs 1
Files 154
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

27 Aug 2025 08:15PM UTC coverage: 70.588% (-0.2%) from 70.815%
17277690859

push

github

web-flow
feat: introduce request-scoped background tasks & async mail sending (#2126)

## Summary
Introduce a new `apitask` package for running background tasks within
the lifecycle of an API request. We then use this feature in the mailer
client to send emails in the background. Before the request returns to
the caller we first wait for all in-flight tasks to exit.

**Summary:**
* Define a `Task` interface for light background work.
* Add `Run(ctx, task)` to schedule tasks asynchronously when supported,
or fall back to synchronous execution otherwise.
* Add `Wait(ctx)` to block until all request-scoped tasks finish
* Add `Middleware` to wrap HTTP handlers, attaching a request-scoped
worker to the context and ensuring all tasks complete before returning a
response.
* Add a check for `EmailBackgroundSending` in mailer package, when
present wrap the mail client in a `backgroundMailClient`. When `Mail` is
called it will send a `mailer.Task` to `apitasks.Run` to send the email
in the background using the wrapped `MailClient`.
* Add config `GOTRUE_MAILER_EMAIL_BACKGROUND_SENDING` (def `false`) -
on/off switch.

I will follow up with unit tests once the team has had an opportunity to
review.

---------

Co-authored-by: Chris Stockton <chris.stockton@supabase.io>

55 of 116 new or added lines in 5 files covered. (47.41%)

66 existing lines in 3 files now uncovered.

12348 of 17493 relevant lines covered (70.59%)

69.65 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
90.28
-1.27% internal/api/options.go
2
85.39
-0.38% internal/api/api.go
25
59.02
internal/api/apitask/apitask.go
33
36.63
-30.76% internal/mailer/mailer.go

Uncovered Existing Lines

Lines Coverage ∆ File
8
42.86
-12.7% internal/mailer/noop.go
28
0.0
0.0% internal/mailer/mailme.go
30
36.63
-30.76% internal/mailer/mailer.go
Jobs
ID Job ID Ran Files Coverage
1 17277690859.1 27 Aug 2025 08:23PM UTC 154
70.59
GitHub Action Run
Source Files on build 17277690859
  • Tree
  • List 154
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2c8ea611 on github
  • Prev Build on master (#17273411118)
  • Next Build on master (#17278664257)
  • 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

© 2025 Coveralls, Inc