-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Show improved error panel instead of annoying snackbar or crashing #5148
Conversation
If you summon me, I know I have to oblige. :) |
Yeah, thank you, this fixes #4026, i.e. the error screen only appears if the users asks to or if an unrecoverable error happened (for which it would be impossible to restore the previous state) |
THANK YOU SO MUCH FOR FIXING THIS! CAN I HAVE YOUR BABIES??? |
I rebased, fixed tests and added screenshots to the PR description @TobiGr @B0pol |
Going back from the Error Activity now generates a couple of extra "Back" actions. Switch to Bookmarked Playlists tab > Open a local playlist > Open a video > Open the Error Activity > Go back. You see the video minimized, and you're back at the Bookmarked Playlists tab. The app should just close the Error Activity and stay on whatever page the Report button is on. |
1790548
to
88c5207
Compare
@opusforlife2 here you are. I have completely removed "returnActivity", so that now the back arrow and button just do as expected and nothing is ever lost. |
Confirmed fixed! |
94690ce
to
8f21460
Compare
I rebased and solved the leftover TODOs. This is now ready. @TobiGr @opusforlife2
This apk throws random errors every once in a while on network requests, to make testing simpler: app-debug.zip |
The latest APK crashes to home screen for me upon opening. If I then open it again from Recent Apps, it shows me an actual Error Activity. Also, @TobiGr this Markdown formatted crash report generated using the button doesn't contain the GMT Time and Package headers. Is it not supposed to? Exception
Crash log
|
@opusforlife2 fixed: https://github.com/TeamNewPipe/NewPipe/suites/1839064245/artifacts/35575997 |
Fixed. 👍 I don't see any difference between the last (working) version and the latest one. Is there supposed to be any? |
@opusforlife2 these: #5148 (comment) |
I rebased again, and improved how the loading indicator is shown in the feed fragment |
@mqus I'm not sure if you've missed that, but to be sure, the APK is designed to throw random exceptions for testing purposes. |
Yeah, thats why I wrote
And
|
There is just one bug with the last debug APK provided: we couldn't share the error report with the share button in the error activity: the shared report is empty. |
Ah I noticed that but thought that this was due to signal(where I tried it) not correctly accepting it. My bad for not testing better. |
It will be shown even when nothing could be loaded not due to a network error, and the user can choose to ignore or report it. Also improve error reporting arguments Also completely refactor error activity Also improve some code here and there
Make sure the url not supported dialog is only shown when the url is really not supported, not on any ExtractionException
Sorry, I accidentally removed a |
I can confirm that this issue is fixed on my device. |
Show improved error panel instead of annoying snackbar or crashing
What is it?
Description of the changes in your PR
This PR improves the error panel that currently is only shown when there are network problems:
ContentNotSupportedException
s andContentNotAvailableException
s, like before.ReCaptchaException
s, where instead a "Solve" button is shown.I also refactored many things related to error reporting, in particular:
error
subpackage.ErrorPanelHelper
class to handle the error panel.ErrorInfo
to store ALL of the information about an error that is needed to perform a report, so that functions can just take anErrorInfo
instead of having to do multiple overloads. This reduced and simplified much the code.BaseStateFragment
and instead make only one, that handles the error panel by itself.returnActivity
forErrorActivity
: it was only used inSettingsFragment
s (set toSettingsActivity
, but without it everything just works as intended) and inRouterActivity
(set toMainActivity
: when something failed while resolving a shared link, the error activity shows up, but now when the user presses back he is just brought to what he was doing before sharing the link to NewPipe, which is expected, instead of unexpectedly going to NewPipe'sMainActivity
). Also removeActivityCommunicator
, now unneded as it was only needed to pass returnActivity around. This solves the "lost backstack" issue when the error activity opens, so that the user can report something and then continue browsing without losing anything. @opusforlife2 :-DOther relevant changes:
VideoDetailFragment
. Now, instead of hiding, alpha is just set to0.0f
.EmptyFragment
not being scrollable insideVideoDetailFragment
.onResume
, i.e. after a fragment was paused.SearchFragment
onResume
behaviour, that was accidentally showing suggestion and meta info panels from the previous search for a brief moment even though it was asked to load something else.TODO
Fixes the following issue(s)
Fixes #4026
Closes #5359 (becomes not relevant)
APK testing
Do you like this behaviour, instead of the old one where the app crashed clearing activity stack and with annoying snackbars preventing access to comments?
This apk throws random errors every once in a while on network requests, to make testing simpler: app-debug.zip
Due diligence