fix(ui): show specific Bible passage error messages#203
Conversation
Map BibleTextView errors to clearer user-facing messages for missing passages, missing or invalid app keys, forbidden access, rate limits, unreachable server/timeouts, and 5xx responses. Extract the error-message mapping into a dedicated UI helper and extend component tests to cover the new cases.
🦋 Changeset detectedLatest commit: 6fcfbc6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Greptile SummaryThis PR extracts a new Key changes:
Minor findings:
Confidence Score: 5/5Safe to merge — all remaining findings are non-blocking P2 style suggestions with no correctness or runtime impact. The two previously flagged issues (5xx/not-found ordering and offline test isolation) have been properly addressed in this revision. The error-mapping logic is correct, the new tests are well-targeted, and the changeset follows the unified versioning policy. The only open items are a missing test for the generic fallback path and a stale JSDoc comment, both P2 with no impact on runtime behaviour. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[BibleTextView receives error] --> B[getBibleTextErrorMessage]
B --> C{status === 401?}
C -- Yes --> D[INVALID_APP_KEY_MESSAGE]
C -- No --> E{status === 403?}
E -- Yes --> F[FORBIDDEN_MESSAGE]
E -- No --> G{status === 429?}
G -- Yes --> H[RATE_LIMITED_MESSAGE]
G -- No --> I{status >= 500?}
I -- Yes --> J[SERVER_ERROR_MESSAGE]
I -- No --> K{status === 404 OR message includes 'not found'?}
K -- Yes --> L[PASSAGE_NOT_FOUND_MESSAGE]
K -- No --> M{navigator.onLine === false?}
M -- Yes --> N[UNREACHABLE_SERVER_MESSAGE]
M -- No --> O{isUnreachableServerError message?}
O -- Yes --> N
O -- No --> P[GENERIC_ERROR_MESSAGE]
D & F & H & J & L & N & P --> Q[VerseUnavailableMessage renders message]
Reviews (4): Last reviewed commit: "chore: add changeset" | Re-trigger Greptile |
|
@greptile are all your concerns addressed satisfactorily? |
|
Yes, both concerns are addressed: P1 (5xx shadowing): Fixed by checking P2 (offline test isolation): Fixed by using |
|
@cameronapak I'd love your thoughts on this. Is there a different way you'd suggest that this be structured? Feel free to completely rewrite this if I'm not approaching it the right way. |
cameronapak
left a comment
There was a problem hiding this comment.
This looks good to me. Thank you for making it where we have better, more specific error copy! Can you run pnpm changeset at the project's root to bump all of the packages, so that the changes propogate into the next version? (we bump them all at once for them to stay on the same version across the board for react sdk packages)
|
@cameronapak changeset added; care to re-review? |
|
Approved! |
Map BibleTextView errors to clearer user-facing messages for missing passages, missing or invalid app keys, forbidden access, rate limits, unreachable server/timeouts, and 5xx responses.
Extract the error-message mapping into a dedicated UI helper and extend component tests to cover the new cases.