Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Addresses review feedback from PR #810: the dev server could start before Supabase services were fully initialized, causing connection failures.

Changes

  • Health check in scripts/ensure-supabase.sh: After starting Supabase, polls Auth service health endpoint (60s timeout) before returning. Prevents race conditions where Next.js attempts database connections before Supabase is ready.

  • Documentation updates: Simplified README.md and docs/DEVELOPMENT.md to reflect that pnpm run dev now handles Supabase startup automatically—no separate terminal needed.

Implementation

Follows the same health check pattern used in scripts/supabase-init-for-tests.sh:

SUPABASE_AUTH_HEALTH_URL="http://127.0.0.1:54321/auth/v1/health"
while true; do
    if curl -fsS --max-time 2 "${SUPABASE_AUTH_HEALTH_URL}" > /dev/null 2>&1; then
        echo "Supabase Auth service is ready."
        break
    fi
    # ... retry logic with timeout
done

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com>
Copilot AI changed the title [WIP] Ensure Supabase is running before dev server starts Add health check and update docs for automated Supabase startup Jan 19, 2026
@vercel
Copy link

vercel bot commented Jan 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
pin-point Ready Ready Preview, Comment Jan 19, 2026 6:32pm

@timothyfroehlich timothyfroehlich marked this pull request as ready for review January 19, 2026 19:39
Copilot AI review requested due to automatic review settings January 19, 2026 19:39
@timothyfroehlich timothyfroehlich merged commit 8986a4d into chore/run-dev-starts-supabase Jan 19, 2026
2 checks passed
@timothyfroehlich timothyfroehlich deleted the copilot/sub-pr-810 branch January 19, 2026 19:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the automated Supabase startup by adding a health check that waits for services to be fully initialized before allowing the dev server to start. This addresses a race condition identified in PR #810 where Next.js could attempt database connections before Supabase was ready.

Changes:

  • Added health check polling in ensure-supabase.sh with 60-second timeout to verify Auth service readiness
  • Updated developer documentation to reflect that pnpm run dev now fully handles Supabase startup without requiring a separate terminal

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
scripts/ensure-supabase.sh Added health check loop that polls Auth service endpoint after Supabase starts, with retry logic and timeout handling
docs/DEVELOPMENT.md Simplified quickstart instructions to show single command for dev server startup
README.md Updated local setup to reflect automated Supabase handling in dev command

timothyfroehlich added a commit that referenced this pull request Jan 19, 2026
* chore: ensure supabase is running before dev server starts

* Update scripts/ensure-supabase.sh

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add health check and update docs for automated Supabase startup (#811)

* Initial plan

* feat: add health check and update docs for automated Supabase startup

Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants