New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 735040 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug

Blocking:
issue 586194



Sign in to add a comment

Local storage deletion is flaky

Project Member Reported by msramek@chromium.org, Jun 20 2017

Issue description

Tested on 61.0.3137.0:

Steps:
1. Open a random page (e.g. localhost)
2. Add a few local storage entries (e.g. by executing 'localStorage["key"] = "value";' in the DevTools console
3. Verify that they have been added (e.g. by executing 'localStorage.length > 0' in the DevTools console, which should return 'true')
4. Open 'chrome://settings/clearBrowserData' in a new tab
5. Clear 'Cookies and other site data'
6. Verify that local storage is empty ('!!localStorage.length')

Expected:
7. Local storage is empty ('true')

Actual:
7. Local storage is not empty ('false')
 
This is reproducible flakily, but in >50% of cases when I tested.
I verified that the call reached StoragePartitionImpl::ClearLocalStorageOnUIThread(), so the bug is somewhere lower than that.
DomStorageContextImpl::DeleteLocalStorage and/or DomStorageContextImpl::DeleteLocalStorageForPhysicalOrigin are not called in cases of unsuccessful deletion.

So the bug is somewhere in StoragePartitionImpl.
StoragePartitionImpl::OnLocalStorageUsageInfo doesn't see the origin in question. The data is not deleted, because the storage partition doesn't know it's there.

...even though the DevTools and the origin info bubble do.
Cc: mek@chromium.org
Owner: michaeln@chromium.org
So the bug is in DOMStorageContextImpl::GetLocalStorageUsage. Passing to owners for triage.

Comment 6 by mek@chromium.org, Jun 20 2017

Cc: -mek@chromium.org michaeln@chromium.org
Owner: mek@chromium.org
Anything related to DOMStorageContextImpl is likely a red herring. In M61 localstorage is no longer implemented in DOMStorageContextImpl but in LocalStorageContextMojo instead.

Having said that, this still sounds like a bug of course.

Comment 7 by mek@chromium.org, Jun 20 2017

What is probably happening is that the data hasn't been committed to disk yet, which causes the new implementation of GetLocalStorageUsage to not include the origin at all (the old implementation would generally not count uncommitted data as usage either, but since it would have an empty sqlite database for the origin, that would be included).

Comment 8 by mek@chromium.org, Jun 20 2017

Blocking: 586194
Status: Started (was: Available)
Project Member

Comment 9 by bugdroid1@chromium.org, Jun 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8309dd9de3baa6a3897d3b1fe094e26846f9bad8

commit 8309dd9de3baa6a3897d3b1fe094e26846f9bad8
Author: Marijn Kruisselbrink <mek@chromium.org>
Date: Thu Jun 22 19:57:44 2017

Make GetStorageUsage include orgins with only uncommitted data.

In general GetStorageUsage only returns usage as it is on disk, which
means it only returns committed data. But the same API is also used to
figure out which origins have localstorage data in general, so make sure
to always include all origins that haven't been committed to disk yet as
well. In the old code this worked automatically since opening
localstorage would cause an empty sqlite database to be created for that
origin.

Bug:  735040 
Change-Id: Idc5410f30404c8ba6d5110416cb019d5d4c415ea
Reviewed-on: https://chromium-review.googlesource.com/541498
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481638}
[modify] https://crrev.com/8309dd9de3baa6a3897d3b1fe094e26846f9bad8/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ManageSpaceActivity.java
[modify] https://crrev.com/8309dd9de3baa6a3897d3b1fe094e26846f9bad8/content/browser/dom_storage/local_storage_context_mojo.cc
[modify] https://crrev.com/8309dd9de3baa6a3897d3b1fe094e26846f9bad8/content/browser/dom_storage/local_storage_context_mojo_unittest.cc

Comment 10 by mek@chromium.org, Jun 26 2017

Status: Fixed (was: Started)

Sign in to add a comment