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

[FBD] Storage is not reset if the timer is disrupted #34158

Open
quaqo opened this issue Nov 7, 2023 · 2 comments
Open

[FBD] Storage is not reset if the timer is disrupted #34158

quaqo opened this issue Nov 7, 2023 · 2 comments
Labels
OS/Android Fixes related to Android browser functionality

Comments

@quaqo
Copy link

quaqo commented Nov 7, 2023

Tested on Android Brave | 1.60.110

Forget by Default is set. A few websites that I want to maintain the login are excluded using per-domain Shields UI.

If Brave is closed, or loses focus, I think the KeepAlive timer is disrupted and the data is never cleared.
I'd expect a check on the next Brave start, or whenever it is convenient, and cleanup all the storage that needs to be reset.

Related to #30090 and #26465

@quaqo quaqo added the OS/Android Fixes related to Android browser functionality label Nov 7, 2023
@quaqo
Copy link
Author

quaqo commented Nov 7, 2023

It works fine on my side, I tested with optimized, unrestricted and even restricted Battery settings in Brave, and the browser after 30 seconds removed the data when I went back to the app. I also, the data gets closed on browser's exit regardless of time, I used the Exit button and closed it through the android apps manager 'cards' and it worked fine.

That's not how it works as far as I understand. The data doesn't get cleared on browser exit ever.
If data is to be cleared and the browser exits, the data is erased at startup after a delay.

It's harder to test this on android though, unless you use the devtools. but for example on Desktop, all it does is to add "brave_remember_1p_storage":{"[*.]brave.com,*":{"last_modified":"13343865355667002","setting":1}} to the Preferences file. settings 1 to keep and settings 2 to clear. As you can see it will whitelist everything so community, search and main Brave website will retain the data.

So even doing it 'whitelist' mode will work as expected here, the only way to see this is in Android is by going to (I think this is the correct url) brave://prefs-internals, where you will be able to see the preferences file in plain text, that way you will know if a site that is not getting cleared is disabled or enabled correctly.

I had already checked the brave_remember_1p_storage settings and they're correctly set.

I am not even sure if you know it is 30 seconds the time it takes for Forgetful Browsing to clear data,

I do know. That's the whole point of mentioning the timer and referring to #30090 and #26465.

The only time clearing data on Exit fails is when people use Shutdown or something that will close Brave processes 'too fast' for it to complete the job, besides that, it always does the job fine in my experience.

The point of this issue is exactly that. The data shouldn't be cleared just on tab exit with a timer. If the timer doesn't get to fire the data doesn't get reset.
At that point the startup cleaning routine should kick in, reading from ephemeral_storage.first_party_storage_origins_to_cleanup which sites didn't get reset, but this doesn't happen for me. And I verified that first_party_storage_origins_to_cleanup doesn't get populated at all if I just exit Brave.

In order for it to get populated Brave needs to stay active. So, for example, exiting Brave with an active tab breaks 1p storage cleaning for me (i.e. the domain in that tab doesn't get written to first_party_storage_origins_to_cleanup).

@quaqo
Copy link
Author

quaqo commented Nov 7, 2023

In order for it to get populated Brave needs to stay active. So, for example, exiting Brave with an active tab breaks 1p storage cleaning for me (i.e. the domain in that tab doesn't get written to first_party_storage_origins_to_cleanup).

close_tabs_on_exit may play a role. If I open a blank new tab, close the other tab and then exit, Brave cleans everything on the next startup (the website is in first_party_storage_origins_to_cleanup).

Steps to reproduce

  1. close_tabs_on_exit = True
  2. FBD enabled
  3. Navigate to a website
  4. Menu > Exit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS/Android Fixes related to Android browser functionality
Projects
None yet
Development

No branches or pull requests

1 participant