Bug #963
closedThe current tab is not always the active one after an app restart.
Added by Hund Why do I need a last name over 1 year ago. Updated over 1 year ago.
0%
Description
I have a weird and possibly severe issue, where Privacy Browser focuses the tab to the left of the current tab, only that the current tab is still visually active.
If I tap the button to toggle JavaScript, it then activates/disable JavaScript for the left tab that's visually in the background.
I don't know why or how it happens. It happens often, on a daily basis though.
I'm using LineageOS 19 (Android 12) on a Pixel 3a with Privacy Browser 3.13.2 from F-Droid.
Updated by Soren Stoutner over 1 year ago
- Assignee set to Soren Stoutner
- Priority changed from 3.x to Critical Bug
This is a critically serious behavior if I understand you correctly that when you enable JavaScript it enables it for the wrong tab.
So far I am unable to replicate the problem. Could you please post a video showing the behavior in action (enable the showing of taps in the video if possible)? Sometimes there are subtle visual clues as to the underlying cause that I notice as the developer whose significance are not readily obvious to everyone else. If the video is too large to attach to Redmine, you can post it somewhere else on the web and attach a link.
Updated by Hund Why do I need a last name over 1 year ago
It just happened again. I can navigate the other tab as well. I hope the video is good enough.
https://cloud.operationtulip.com/s/8yncrm427HeGDfM
It seems to happen when the browser have been running for some time.
Updated by Soren Stoutner over 1 year ago
From the video, it appears that Privacy Browser thinks the wrong tab is currently active. That this happens after the browser has been running for a long time indicates that this could be related to the OS stopping Privacy Browser in the background, and the code that winds up thinking the wrong tab is active is related to the resume process.
When you switch tab at the end of the video and that fixes the problem, that is because every time a tab is switched it re-records which tab is active.
I am going to dig around in the code and see if I can figure out what is happening.
Updated by Soren Stoutner over 1 year ago
I have made a modification that might fix the problem, but it needs testing. Below is a link to a debug test build. You can install it next to your current Privacy Browser, export and import your settings, and see if it fixes your problem. The link below will be valid for a few days.
https://nextcloud.stoutner.com/s/RtGWCWqqs7eyXDY
I am also testing this build myself. The wo things I a most worried about checking.
1. This might not fix the issue.
2. A different tab might end up be selected in the background. Specifically, it might be the last tab instead of the one to the left.
I would consider number 2 to be highly unlikely, but it merits testing because this entire restore process happens asynchronously, meaning that every tab is being restored concurrently, and how long it takes each tab to restore depends on how complex the contents are, which can confuse the process if they get out of order. In other words, this is what is known as a race condition.
Updated by Soren Stoutner over 1 year ago
Note that the OS stops apps in the background when it needs RAM. Phones with less RAM, like the Pixel 3a with 4GB, will experience this more often than my daily driver (Pixel 5 with 8GB). This especially happens when doing things like taking pictures, which uses a lot of RAM for all the post processing and often causes background apps to be stopped. This means that you will be able to tell if this is fixed easier than I will.
Updated by Soren Stoutner over 1 year ago
- Subject changed from Privacy Browser focuses the tab to the left of the current tab, only that the current tab is still visually active. to The current tab is not always the active one after an app restart.
Updated by Hund Why do I need a last name over 1 year ago
Thanks! I will try it out. :)
Updated by Hund Why do I need a last name over 1 year ago
I haven't had any issues so far. :) I even tried my best to use all the memory that I could.
Updated by Soren Stoutner over 1 year ago
Thanks for testing that. I will prepare a bugfix release.
Updated by Soren Stoutner over 1 year ago
- Status changed from New to Closed
Updated by Soren Stoutner over 1 year ago
Updated by Hund Why do I need a last name over 1 year ago
I have a new bug now. Instead of this bug, I get back to a web browser with the JavaScript button indicating that JavaScript is turned off. If I click the button, the browser crashes.
Updated by Soren Stoutner over 1 year ago
It sounds like you have discovered #981, which was fixed in Privacy Browser 3.13.4.
Updated by Hund Why do I need a last name over 1 year ago
Thanks! I'll wait for that version to hit F-Droid. :)
Updated by Soren Stoutner over 1 year ago
F-Droid was having some update problems, but those appear to be solved, so 3.13.4 should be available there shortly.
https://forum.f-droid.org/t/no-updates-in-the-f-droid-repo/21800