Skip to content

Fix Fly.io health checks and Stripe API expand depth#509

Merged
bokelley merged 3 commits into
mainfrom
bokelley/fix-health-check-and-stripe
Jan 3, 2026
Merged

Fix Fly.io health checks and Stripe API expand depth#509
bokelley merged 3 commits into
mainfrom
bokelley/fix-health-check-and-stripe

Conversation

@bokelley

@bokelley bokelley commented Jan 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix Fly.io health check to use /health endpoint instead of / (homepage)
  • Fix Stripe API expand depth error (exceeds 4-level limit)
  • Add Express trust proxy configuration for accurate client IP detection

Details

Health Check Fix

The health check was configured to hit / (homepage) which can be slow due to external API calls. Changed to use the dedicated /health endpoint that only checks database connectivity and Addie readiness.

Also increased timeout from 2s to 5s and grace period from 5s to 30s to allow proper initialization.

Stripe API Fix

Removed data.lines.data.price.product from Stripe API expand arrays (5 levels exceeds 4-level limit). Added product caching in getPendingInvoices to fetch product names separately.

Trust Proxy

Added app.set('trust proxy', 1) for Fly.io to fix rate limiter IP detection warnings.

Test plan

  • Deploy to staging and verify health checks pass
  • Verify Stripe invoice listing works without errors
  • Check rate limiter logs no longer show trust proxy warning

🤖 Generated with Claude Code

bokelley and others added 3 commits January 3, 2026 14:47
- Remove data.lines.data.price.product from Stripe API expand arrays
  (exceeds 4-level depth limit causing errors)
- Add product caching in getPendingInvoices to fetch products separately
- Configure Express trust proxy for Fly.io to fix rate limiter IP detection

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change health check path from "/" to "/health"
- The homepage "/" can be slow due to external API calls (Stripe, etc.)
- The /health endpoint is designed for quick health checks
- Increase timeout from 2s to 5s and grace_period from 5s to 30s
  to allow proper initialization on startup

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit 71777ef into main Jan 3, 2026
6 checks passed
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.

1 participant