Promote to prod: remove non-existent books from the home screen - #9
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small follow-up promotion. Two fixes, one of them user-visible.
The home screen was offering books that do not exist.
dashboard_repositorysubstituted 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_KEYexists only in the deployedfunction environment, so deploying
services/paymentsfrom this repo would breaklive checkout and only fail at request time. Deploys were already scoped to
functions:apiby convention; a predeploy script now enforces it.Verified locally: reader analyze clean, 7 reader tests, lint 5/5, 32 API tests.