Repository navigation
fix(ui, services): distinguish network errors from not found states (#144) - #156
Conversation
|
Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here. So far, Strix has reviewed 14 pull requests across this workspace. |
|
Thanks for the pull request, @Tanmaypatil-25. A couple of things from CONTRIBUTING.md before this can be reviewed:
Review is done by one person in their spare time, so these rules keep the queue moving for everyone. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
aashu2006
left a comment
There was a problem hiding this comment.
nice one @Tanmaypatil-25 , exactly what #144 needed 🙌
Real "not found" still shows not found, everything else gets a retry, and the tests cover both. Merging!
Summary
Resolves #144.
Previously, network drops, server hiccups, or Supabase connection errors during profile and prompt loading were swallowing errors and returning
null, causing the UI to falsely display "Profile not found" or "Prompt not found" rather than a query failure state.Changes
src/services/supabase/profiles.ts): UpdatedgetProfileto only returnnullfor legitimate "no rows found" errors (PGRST116). All other database/network errors are now re-thrown so React Query properly marks them as failed.src/pages/PromptDetail.tsx): Refined query error handling to throw non-PGRST116 errors and wired up<QueryError>with a retry button when loading fails.src/pages/Profile.tsx): Configured failure states to render<QueryError>and retry controls when profile fetching fails, reserving "not found" strictly for verified missing profiles.PGRST116) and transient network/server errors with successful retry recovery.Testing & Verification
Summary by CodeRabbit
Bug Fixes
Tests