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

supabase / supabase / 26156611531
72%

Build:
DEFAULT BRANCH: master
Ran 20 May 2026 10:29AM 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

20 May 2026 10:26AM UTC coverage: 71.809%. Remained the same
26156611531

push

github

web-flow
fix(cli): resolve infinite loader on device code screen (#46137)

## Summary

Follow-up fix for
[#46120](https://github.com/supabase/supabase/pull/46120).

PR #46120 correctly guarded against duplicate `POST /platform/cli/login`
calls using a `useRef`, but left `navigate` in the `useEffect` deps
array. Because the parent passes an inline lambda, `navigate` gets a new
reference on every render. This causes React to:

1. Run the effect cleanup mid-flight (setting `isActive = false`)
2. Re-run the effect, which hits the session-id ref guard and returns
early

When step 1 happens while the POST is in-flight, the response arrives
with `isActive === false`, silently drops the `navigate(...)` call, and
leaves status stuck at `{ _tag: 'loading' }` — the infinite spinner
reported in Slack.

## Fix

Store `navigate` in a ref (updated each render) and call
`navigateRef.current(...)` inside `createSession`. Remove `navigate`
from the deps array so parent re-renders never trigger a cleanup while
the POST is in-flight.

```ts
const navigateRef = useRef(navigate)
navigateRef.current = navigate   // always up to date, never a dep
```

All 7 existing CLI login unit tests pass, including the "POSTs exactly
once even when parent re-renders" regression test.

## Test plan

- [ ] Run `pnpm test:studio tests/pages/cli-login.test.tsx` — all 7
tests pass
- [ ] Browser: `supabase login` flow completes and shows the
verification code screen without hanging on the loader
- [ ] DevTools Network: exactly one `POST /platform/cli/login` fires per
login attempt

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved CLI login navigation reliability when parent components
update during session creation.

* **Style**
  * Adjusted loading indicator styling on the CLI login screen.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://sto... (continued)

965 of 1364 branches covered (70.75%)

Branch coverage included in aggregate %.

1488 of 2052 relevant lines covered (72.51%)

240.58 hits per line

Subprojects
ID Flag name Job ID Ran Files Coverage
1 studio-tests 26156611531.1 20 May 2026 10:29AM UTC 94
71.81
GitHub Action Run
Source Files on build 26156611531
  • Tree
  • List 94
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #26156611531
  • df77fc90 on github
  • Prev Build on master (#26155173900)
  • Next Build on master (#26157181266)
  • 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