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

medplum / medplum / 28404808389
92%

Build:
DEFAULT BRANCH: main
Ran 29 Jun 2026 10:08PM UTC
Jobs 1
Files 844
Run time 2min
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

29 Jun 2026 09:46PM UTC coverage: 91.887% (+0.02%) from 91.871%
28404808389

push

github

web-flow
fix(core): bound the 401 retry in MedplumClient to prevent infinite loops (#9680)

A 401 on a not-locally-expired access token previously looped forever. The
unauthenticated path (request -> handleUnauthenticated -> refresh -> request)
had no attempt counter, and refresh()/runRefreshWithLock only re-mint when
isAuthenticated() is false. A 401 on a token whose exp is still in the future
short-circuited the re-mint and re-sent the rejected token, recursing without
bound -- a production OOM, triggered when a still-valid Login is evicted from
Redis (Logins are cache-only) under high eviction pressure.

Make the 401 path bounded and terminal: at most 2 attempts per logical request
(1 initial + 1 recovery), tracked per-request via RequestState.authAttempt so
concurrent requests have independent budgets. The recovery forces a re-mint via
a `force` flag threaded through refresh() -> runRefreshWithLock(), which skips
the expiry short-circuit for the rejected token while still adopting a newer
token a peer tab already produced. A 401 on the recovery attempt is terminal:
clear auth, call onUnauthenticated, throw -- never recurse. Single-flight is
preserved (concurrent 401s collapse into one re-mint); the fetchWithRetry
429/5xx retry budget is untouched.

Signed-off-by: Joshua Kelly <josh@flexpa.com>

21574 of 24523 branches covered (87.97%)

Branch coverage included in aggregate %.

11 of 11 new or added lines in 1 file covered. (100.0%)

2 existing lines in 2 files now uncovered.

38495 of 40850 relevant lines covered (94.24%)

12521.34 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
95.16
-0.81% packages/agent/src/hl7-client-pool.ts
1
94.31
0.64% packages/core/src/client.ts
Jobs
ID Job ID Ran Files Coverage
1 28404808389.1 29 Jun 2026 10:08PM UTC 844
91.89
GitHub Action Run
Source Files on build 28404808389
  • Tree
  • List 844
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • ceb41d45 on github
  • Prev Build on gh-readonly-queue/main/pr-9684-3ade8e56ec3b3c903132604e58e32699d3d9dd66 (#28401967894)
  • Next Build on main (#28406936143)
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