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

supabase / storage / 46675311574
89%

Build:
DEFAULT BRANCH: master
Ran 01 Dec 2026 03:09PM UTC
Jobs 2
Files 407
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

01 Dec 2026 03:07PM UTC coverage: 88.841% (+0.02%) from 88.824%
46675311574

push

github

web-flow
feat(queue): metric and log for synchronous job invocations (#1759)

## What

Adds a metric and a log line for every time a queue handler runs
**synchronously**, in-process on the caller, instead of from the queue.
Today these runs are hard to see: the fallback logs a warning before it
runs, but nothing tracks how often it happens, for which queue, or
whether the inline run worked.

### Metric

`queue_job_sync_invocations_total` (counter), one increment per inline
dispatch call (a call can carry several messages; the message count is
in the log line):

| label | values |
|---|---|
| `name` | queue name (e.g. `webhooks`, `object-admin-delete`) |
| `reason` | `invoke`: explicit `queue.invoke` (e.g.
`BucketDeleted.invoke`, `BucketCreatedEvent`)<br>`queue_disabled`:
env-disabled sync queue (`PG_QUEUE_ENABLE=false`)<br>`send_failed`:
`syncFallback` ran the handler after a failed enqueue |
| `status` | `ok` / `error`: whether the inline call succeeded |

Example: `sum by (name)
(rate(queue_job_sync_invocations_total{reason="send_failed"}[5m]))`
shows enqueue failures that degraded to inline runs, per queue.

### Log

One `[Queue] Invoked synchronously` line per call: `debug` on success
(the counter already covers it), `warning` with the `error` on failure.
It carries `type: "queue"`, `project` (only when every message in the
call belongs to the same tenant), `sbReqId`, and `metadata` with
`queue`, `reason`, `status`, `count`, `eventTypes` and `durationMs`.

## How

- `observeSyncInvocation()` in `src/internal/queue/middleware.ts` wraps
an inline dispatch and records the metric and the log.
- `syncFallback` wraps its `invokeMany` (`send_failed`). `syncModeGuard`
wraps the forwarded produce (`queue_disabled`).
- `instance.ts` wraps the public `invoke` and `invokeMany` of each queue
shape it builds (full manager, producer-only, sync queue) for reason
`invoke`. The fallback and the sync queue captured the manager's own
references when they were built, so nothin... (continued)

10442 of 12345 branches covered (84.58%)

Branch coverage included in aggregate %.

42 of 44 new or added lines in 3 files covered. (95.45%)

17965 of 19630 relevant lines covered (91.52%)

1276.81 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
66.03
2.98% src/internal/queue/instance.ts
Jobs
ID Job ID Ran Files Coverage
1 rest-pg18 - 46675311574.1 01 Dec 2026 03:16PM UTC 380
68.81
GitHub Action Run
2 unit - 46675311574.2 01 Dec 2026 03:09PM UTC 399
72.63
GitHub Action Run
Source Files on build 46675311574
  • Tree
  • List 407
  • Changed 5
  • Source Changed 3
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #46675311574
  • c2dce3f0 on github
  • Prev Build on master (#46672764172)
  • Next Build on master (#46680176435)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc