Skip to content

Error handling improvements#457

Closed
mykhailodanilenko wants to merge 2 commits intoOwnTube-tv:mainfrom
mykhailodanilenko:feature/refresh-token-fix
Closed

Error handling improvements#457
mykhailodanilenko wants to merge 2 commits intoOwnTube-tv:mainfrom
mykhailodanilenko:feature/refresh-token-fix

Conversation

@mykhailodanilenko
Copy link
Copy Markdown
Contributor

🚀 Description

This PR improves the error handling mechanisms and logging across the application, while fixing some of the errors related to refresh token handling. Also, a small test for error handling is added to the "copy diagnostic info" button, press it 5 times in a row and observe the result.

📄 Motivation and Context

#451

🧪 How Has This Been Tested?

  • Web (desktop)
  • Web (mobile)
  • Mobile (iOS)
  • Mobile (Android)
  • TV (Android)
  • TV (Apple)

📦 Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist (copied from README)

  • Squash your changes into a single clear and thoroughly descriptive commit, split changes into multiple commits only when it contributes to readability
  • Reference the GitHub issue that you are contributing on in your commit title or body
  • Sign your commits, as this is required by the automated GitHub PR checks
  • Ensure that the changes adhere to the project code style and formatting rules by running npx eslint . and npx prettier --check ../ from the ./OwnTube.tv/ directory (without errors/warnings)
  • Include links and illustrations in your pull request to make it easy to review
  • Request a review by @mykhailodanilenko, @ar9708 and @mblomdahl

…iagnostics; enhance error capturing with detailed diagnostics data.
@mykhailodanilenko mykhailodanilenko self-assigned this Oct 6, 2025
@mykhailodanilenko mykhailodanilenko added bug Something isn't working diagnostics Diagnostics collection and analysis labels Oct 6, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Improves error handling, diagnostics, and session/token refresh logic, adds customizable error page button styling, and introduces diagnostic test behavior when rapidly copying device info.

  • Adds richer error propagation (including collection/query errors) and PostHog diagnostic payloads.
  • Refactors auth/session refresh logic and introduces 401 response handling plus safer cleanup in diagnostics hooks.
  • Adds localized strings and UI tweaks (custom button text color, diagnostic copy stress test).

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
screens/Playlists/index.tsx Passes collection error object into error UI fallback.
screens/Playlists/components/PlaylistVideosView.tsx Avoids suppressing error state when data empty.
screens/Playlist/index.tsx Propagates playlist video load error to VideoGrid.
screens/ChannelsScreen/index.tsx Consolidates error handling and defers to top-level ErrorPage.
screens/ChannelCategoryScreen/index.tsx Adds combined video/category error propagation.
screens/CategoryScreen/index.tsx Adds error state passthrough to VideoGrid.
screens/CategoriesScreen/index.tsx Includes collection error in error resolution logic.
public/featured-instances.json5 Enables username/password login for an instance.
locales/*.json Adds new i18n keys for copy feedback and stress test error.
hooks/useAuthSessionSync.tsx Async session selection with loaded-state guard.
hooks/useAppStateDiagnostics.ts Safeguards optional subscription cleanup.
diagnostics/useCustomDiagnosticEvents.ts Removes unsafe any cast when capturing events.
components/shared/Button.tsx Adds optional textColor override and adjusts text color logic.
components/ErrorPage.tsx Supports custom button styling/colors.
components/ErrorBoundary.tsx Supplies explicit button styling/colors.
components/DeviceCapabilities/DeviceCapabilities.tsx Adds copy feedback, press limit test throwing an error, refactors UI.
components/ChannelView.tsx Avoids hiding component on error state.
components/CategoryView.tsx Adds variant prop and avoids early return on error.
app/_layout.tsx Repositions ErrorBoundary higher in component tree.
api/helpers.ts Adds collection error aggregation and Axios error parsing utility.
api/errorHandler.ts Adds structured diagnostics for HTTP errors.
api/axiosInstance.ts Refines token refresh logic and adds 401 response interceptor.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mykhailodanilenko mykhailodanilenko force-pushed the feature/refresh-token-fix branch from 4b693bd to 8c076d7 Compare October 7, 2025 08:38
@mblomdahl
Copy link
Copy Markdown
Contributor

@claude Please review.

@claude
Copy link
Copy Markdown

claude bot commented Oct 7, 2025

Claude encountered an error —— View job

Failed with exit code 128

I'll analyze this and get back to you.

@ar9708 ar9708 marked this pull request as draft October 7, 2025 09:41
@ar9708 ar9708 marked this pull request as ready for review October 7, 2025 09:41
@ar9708 ar9708 mentioned this pull request Oct 7, 2025
15 tasks
@ar9708
Copy link
Copy Markdown
Contributor

ar9708 commented Oct 7, 2025

Replaced by #459

@ar9708 ar9708 closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working diagnostics Diagnostics collection and analysis

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants