-
-
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
Fix channel subscribe button causing crash on closing #5464
Conversation
@brnwlshubh Can you confirm that it works now? I couldn't reporoduce that problem myself. @Stypox Can you add the reasoning to the commit message, so there is a way to find out why that code exists without digging through github |
Will I have to check existing 0.20.9 package or by installing new apk file ? |
Get the apk from here at the bottom under artifacts https://github.com/TeamNewPipe/NewPipe/actions/runs/498326163 |
Exception
Crash log
|
@brnwlshubh could you provide detailed steps to reproduce? For me everything works well (and it did work well even before). |
When we create Youtube subscribe channel group on the front page. Thank you @Stypox |
Do you also have a channel as a main page tab? That error lies inside the channel view, not the channel groups view, so I don't understand |
Error occured in refreshing the channel group not in opening channel page. Channel page is working fine. |
I understand, but from a code point of view the problem lies in the channel page. So I'm asking: do you have a channel page as a main page tab? |
@Stypox I think the easiest thing would be if @brnwlshubh can create an export of the settings and the channels of the app with which the crash occurs. |
@Stypox Main page is "Trending" and beside this All Subscribed Channel list page |
The binding was being set to null on onDestroyView() instead of in onDestroy()
c17f033
to
327fc74
Compare
@brnwlshubh could you test now? It should be fixed, I tested with the settings you provided. Thank you for them! I edited your comment to hide them, since they could be sensitive information ;-) |
Should I download new App from "checks" section? |
Yes, this is the apk: https://github.com/TeamNewPipe/NewPipe/suites/1873031044/artifacts/36501228 |
Now it's working fine 😊 |
@Stypox Do you have any clue on why that fixes the problem. https://developer.android.com/topic/libraries/view-binding#fragments @Isira-Seneviratne Any ideas? |
@XiangRongLin see #4814 (comment) and #5417 |
@Stypox #5417 Does not have any explanation either and #4814 (comment) got rebased, so i can't see the version of the code anymore that you commented on. With the way its currently displayed there i would still assume that it being in |
@Stypox I have this error when opening the channel page when using RC3. It's very specific:
Hope that helps with debugging. |
@opusforlife2 maybe it's this same error, maybe it's not, can you reproduce in this PR? |
Yup! This PR fixed the bug. 👍 |
I don't understand how your changes fix the bug. @Stypox Can you please explain, why the bindings need to be set to |
I have no idea about this, and neither has @Isira-Seneviratne afaik 😅 |
Sorry for the late reply, I think it's because the RxJava task(s) hold references to the view binding classes. |
Then it should be fixed properly by changing this and not by adding a workaround to the symptoms. For me it also seems like a bad practice for RxJava (logic) to have a reference to the binding (UI), but i don't have any experience with RxJava. References should only go UI -> logic -> data. If it the reference is needed, then the task should be cancelled, when the UI is destroyed. |
@Isira-Seneviratne oh, ok, maybe we know how this can be fixed then. |
@Stypox If you can guarantee that it will be worked on in the next release sure. Otherwise no. |
@XiangRongLin I can't guarantee I will have time to dedicate to this after this release, but it is needed anyway to prevent crashes. |
@Stypox The problem i have with that is that it's then just not going to be done and just forgotten. With the way it is, i would just revert the binding PR because it replaces one problem with another one. The old one im not even sure if it was a problem, since the deprecation is kotlin only. |
I think it's too late to revert view binding, there have been many changes since then |
@TacoTheDank do you have an idea how to solve the problem properly? |
Uff, I don't really know, either. All the ideas I could currently think of were already stated by @XiangRongLin. Would it be possible to revert viewbinding in just the ChannelFragment for now? |
@TacoTheDank this workaround is already being used in many other places so either we revert them all or we revert none |
I added a commit to set the view bindings in the |
@Isira-Seneviratne I think the correct thing to do would be instead to dispose disposables in |
Sure. |
Thank you @Isira-Seneviratne ! Since a proper solution is there that can be reviewed and merged by next release, I'd merge this for now. @TobiGr @XiangRongLin |
…ubscribe-button Fix channel subscribe button causing crash on closing
What is it?
Description of the changes in your PR
This was probably caused by the binding being set to null since the activity was closing, but the async channel subscription disposable being run just after that. #5455 (comment)
Due diligence