Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify error reporting and add error notification #7482

Merged
merged 8 commits into from
Dec 14, 2021
Merged

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Dec 2, 2021

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Followup to Better player error handling #7142
  • Created a ErrorUtil class that contains the three ways to report an error:
    • openActivity: just opens the error activity as always
    • showSnackbar: just opens the error snackbar as always
    • createNotification: creates a notification with a description containing the usual error message, and a title explaining that by tapping on the notification you can report the error. The notification disappears upon tapping, and is set to IMPORTANCE_LOW like other NewPipe notifications so that it does not make sounds.
  • Correctly prevent exception from being serialized in ErrorInfo, eliminating the need for EnsureExceptionSerializable (see commit message for more info)
  • Remove PlayerErrorHandler and instead always show error notification when an error occurs in the player. Also remove the related "report player error" setting.
  • Add two new options in debug settings to show an error snackbar or create an error notification

Before/After Screenshots/Screen Record

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

To test I suggest using the "Crash the player" button from #7142 or triggering #7302 @litetex

Due diligence

Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

Code LGTM only minor things.

Tested it a bit, seems to work as expected.

I'm glad that you managed to get rid of the ugly exception workaround 😄

Only one thing is a bit confusing:
When e.g. a player error happens, the player just stops and I don't notice the notification at the top (in particularly when the notification bar is already full due to my phones notch).
So I think showing a toast that says "Unexpected error occurred, tap notification for details" would be great. I would show the toast whenever a new error notification is shown.

app/src/main/java/org/schabi/newpipe/App.java Outdated Show resolved Hide resolved
@Stypox
Copy link
Member Author

Stypox commented Dec 2, 2021

When e.g. a player error happens, the player just stops and I don't notice the notification at the top (in particularly when the notification bar is already full due to my phones notch).
So I think showing a toast that says "Unexpected error occurred, tap notification for details" would be great. I would show the toast whenever a new error notification is shown.

I agree, I'll improve this

@Stypox
Copy link
Member Author

Stypox commented Dec 3, 2021

You can also test the player error by trying to play in background this live: https://www.youtube.com/watch?v=Q3uwXbkheDo

Activity, snackbar and notification
The wrong @decorator was put in the wrong place to mark the throwable fieldd as transient, now this is fixed and the exception is not serialized. So if a non-serializable throwable is passed, that's not an issue, since it's not going to be serialized. The need for EnsureExceptionSerializable is also gone.
since the notification is silent, also show a toast, otherwise the user is confused
@Stypox

This comment has been minimized.

@AudricV AudricV added the feature request Issue is related to a feature in the app label Dec 4, 2021
@Mhowser

This comment has been minimized.

@litetex

This comment has been minimized.

@Mhowser

This comment has been minimized.

TobiGr added a commit to litetex/NewPipe that referenced this pull request Jan 23, 2022
report_player_errors_title and report_player_errors_summary were removed in TeamNewPipe#7482
This was referenced Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants