brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.56k stars 2.28k forks source link

Not all data stored when visiting a site is deleted when shredding the site #41095

Open StephenHeaps opened 2 days ago

StephenHeaps commented 2 days ago

Description

When a site is shredded, all first party data is removed but caches stored under different domains are not removed

Steps to reproduce

  1. Enable Shred feature flag if not enabled via brave://flags, then quit and relaunch the app.
  2. Close all tabs
  3. Tap ..., then open Settings -> Shields settings -> Manage Website Data view
  4. If there is data stored, tap Remove All to remove all data stored
  5. In an open tab, visit https://google.ca
  6. Tap ..., then open Settings -> Shields settings -> Manage Website Data view
  7. Observe 3 different websites storing data
  8. Tap Done to close Manage Website Data, and close settings
  9. Long-press on the tab tray button and select Shred Site Data
  10. Tap ..., then open Settings -> Shields settings -> Manage Website Data view
  11. Observe google.ca website data is removed, but google.com & gstatic.com data is still there

Actual result

https://github.com/user-attachments/assets/56d6a19b-6497-4668-a324-203a2d44f24c

Expected result

--

Reproduces how often

Easily reproduced

Brave version

v1.69+ (note: Shred feature flag is disabled by default)

Device/iOS version

Any

Affected browser versions

Reproducibility

Miscellaneous information

The Brave iOS Manage Website Data view displays it's data using the WKWebsiteDataStore.fetchDataRecords(ofTypes:completionHandler:) API. This API does not allow retrieving which site stored the given data, so we are only able to remove the data whose displayName we can match to the site being Shred.

kjozwiak commented 1 day ago

@ShivanKaul added it into the 1.70.x milestone as release/blocking for now. If you feel differently or we eventually think it's not, we can remove the label/remove it from the milestone.