fix: handle storage read errors in OfflinePodcastList with error UI and retry (#1954)#2041
fix: handle storage read errors in OfflinePodcastList with error UI and retry (#1954)#2041vedant7007 wants to merge 3 commits into
Conversation
|
Thank you @, for creating the PR and contributing to our UltimateHealth project 💗. |
Automated Review FeedbackNo major issues were identified during this review. The implementation appears consistent with the repository standards and the modified files were reviewed successfully.
|
|
/review |
🤖 Gemini AI Code ReviewSummaryThis Pull Request addresses a critical issue where storage read errors in Overall, the PR significantly improves the robustness and user experience of the offline podcast feature by providing proper error feedback. The implementation is clean and follows good practices for error handling in React components. 🔴 High SeverityNo high severity issues were identified. 🟡 Medium Severity
🟢 Low Severity / Nits
What's Good ✅
VerdictRequest Changes The most critical issue is the ambiguous contract of |
SB2318
left a comment
There was a problem hiding this comment.
@vedant7007
The most critical issue is the ambiguous contract of readDownloadedPodcasts and its handling of non-array data. Depending on the actual behavior of readDownloadedPodcasts, the current if (!Array.isArray(data)) return; could lead to an incorrect "no podcasts" state instead of an "error" state, undermining the core goal of this PR. Clarifying this behavior and adjusting the error handling accordingly is important for robustness. Additionally, consider the sanitization of error messages for production.
…cing error message - removed unreachable !Array.isArray guard since readDownloadedPodcasts is typed to return PodcastDownloadRecord[] - replaced raw err.message with a generic user message to avoid leaking internal storage errors to the UI - switched dev log to console.error for better filtering
|
hey @SB2318 thanks for the review — pushed a follow-up commit addressing the flagged points:
let me know if anything else needs changing! |
|
hey @SB2318 thanks for the review! ping — the concerns you raised were already addressed in commit
diff snapshot on current head: try {
setLoadError(null);
const data = await readDownloadedPodcasts();
setPodcasts(data);
} catch (err) {
if (__DEV__) {
console.error('Offline podcast load error:', err);
}
setPodcasts([]);
setLoadError(
'Failed to load offline podcasts. Please try again or check your device storage.',
);
}CI is red on the standard lockfile drift ( lmk if there's anything else you'd like me to change — happy to iterate! |
|
hey @SB2318 — gentle bump on this one, it's been 10 days since the last activity and my follow-up commit
CI on this repo is still red because of a pre-existing whenever you have a moment to give it another look — thanks! 🙏 |
Closes #1954
the OfflinePodcastList had an empty catch {} that silently swallowed storage read errors. users with valid downloaded podcasts saw an empty list with a generic 'download some podcasts' prompt when the real problem was a storage read failure — no way to distinguish 'no podcasts' from 'load failed'.
what i fixed:
for labels i think gssoc:approved + level:intermediate + type:bug + quality:clean fits here. happy to make changes if needed!