Skip to content

Promote to prod: remove non-existent books from the home screen - #9

Merged
saintjanney merged 1 commit into
mainfrom
develop
Jul 25, 2026
Merged

Promote to prod: remove non-existent books from the home screen#9
saintjanney merged 1 commit into
mainfrom
develop

Conversation

@saintjanney

Copy link
Copy Markdown
Owner

Small follow-up promotion. Two fixes, one of them user-visible.

The home screen was offering books that do not exist.
dashboard_repository substituted hardcoded sample books (The Great Gatsby,
1984, ...) at eight call sites whenever a query returned nothing or threw. Their
download URLs return HTTP 403, so production readers have been seeing "continue
reading" entries that cannot be opened. The screen already renders nothing for an
empty list, so the fallback was worse than the behaviour it replaced, and it hid
real query failures the same way the Library bug did.

Payments redeploy guard. PAYSTACK_SECRET_KEY exists only in the deployed
function environment, so deploying services/payments from this repo would break
live checkout and only fail at request time. Deploys were already scoped to
functions:api by convention; a predeploy script now enforces it.

Verified locally: reader analyze clean, 7 reader tests, lint 5/5, 32 API tests.

…eploys

Two cleanups flagged after the promotion.

DASHBOARD MOCK FALLBACKS. dashboard_repository substituted hardcoded sample books
(The Great Gatsby, 1984, ...) at eight call sites whenever a query returned
nothing or threw. Those books are not real: their download URLs return HTTP 403,
so the production home screen has been offering "continue reading" entries that
cannot be opened. The home screen already renders nothing for an empty list, so
the fallback was worse than the behaviour it replaced, and it hid genuine query
failures the same way the Library screen's swallowed error did. Now the
repository returns empty lists, and the three catch blocks assert in debug builds
so the next failure is loud in development without crashing production.

PAYMENTS REDEPLOY GUARD. PAYSTACK_SECRET_KEY exists only in the deployed function
environment, so deploying services/payments from this repo would replace working
functions with ones that cannot reach Paystack, and it would fail at request time
rather than at deploy time. Deploys are already scoped to functions:api to avoid
this, but that is a convention rather than a safeguard. A predeploy script now
refuses unless the secret is provided deliberately. Verified: exit 1 without it,
exit 0 with it, and a real `deploy --only functions:payments` aborts with the
reason.
@saintjanney
saintjanney merged commit 3172b6a into main Jul 25, 2026
5 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