Skip to content

fix(landing): degrade gracefully when a section's data can't load - #57

Merged
Tatenda merged 1 commit into
developfrom
fix/landing-db-resilience
Aug 4, 2026
Merged

fix(landing): degrade gracefully when a section's data can't load#57
Tatenda merged 1 commit into
developfrom
fix/landing-db-resilience

Conversation

@Tatenda

@Tatenda Tatenda commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Problem

The landing page revamp made / query the database on every request. Any failure took the whole homepage down with a 500.

This is not hypothetical — the develop preview deployment is currently serving an application error:

Invalid `prisma.article.findMany()` invocation:
The column `articles.scheduledAt` does not exist in the current database.
code: 'P2022'

Cause: scripts/migrate-deploy.mjs is production-only by design, so the Neon branch previews fork from was never migrated. It's missing articles.scheduledAt and the site_profile table.

Production is unaffected — I verified flemoji.com/learn queries the same table and renders fine, so the prod database is migrated. Promotion to main will work.

Fix

Both fetches go through safely(), which logs and returns a fallback. Every section already renders an empty state, so the page degrades to that rather than 500ing.

This is the right failure mode independent of the preview drift: a marketing homepage should not disappear because the database is briefly unavailable.

Not fixed here

The preview database drift itself. Options: migrate the Neon main branch, or let previews use the production database. That's an infra decision.

Verification

tsc 0 errors · lint 0 errors · jest 337/337 · / renders locally.

🤖 Generated with Claude Code

`/` is the most important URL on the site, and the revamp made it query the
database on every request — guides via article-service and featured tracks via
MusicService. Any failure in either took the entire homepage down with a 500.

Confirmed in production preview: the Neon branch previews fork from is not
migrated, because scripts/migrate-deploy.mjs is production-only by design. So
`prisma.article.findMany()` fails with P2022 ("The column articles.scheduledAt
does not exist") and the whole landing page returns a server-side exception.
The production database is migrated and unaffected — /learn queries the same
table there and renders — but a homepage that hard-500s on a database hiccup
is the wrong failure mode regardless.

Both fetches now go through `safely()`, which logs and falls back. Every
section already renders an empty state, so the page degrades to that instead
of disappearing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
music-next Ready Ready Preview Aug 4, 2026 4:08pm

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c8844378-3eca-4b9d-be9e-2588c881568f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Tatenda
Tatenda merged commit 8748983 into develop Aug 4, 2026
5 checks passed
@Tatenda
Tatenda deleted the fix/landing-db-resilience branch August 4, 2026 18:07
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