Issue metadata
Sign in to add a comment
|
Chrome devtools for IndexedDB showing wrong/stale data
Reported by
vishal.s...@weather.com,
Jan 5 2017
|
||||||||||||||||||||||
Issue description
Chrome Version : 55.0.2883.95 (64-bit)
URLs (if applicable) : N/A
Other browsers tested:
Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
Safari:
Firefox:
IE:
What steps will reproduce the problem?
(1) The chrome dev tools ---> Application tab --> IndexedDB --> data being displayed is incorrect. It continues to show wrong / stale data even after clicking the refresh button on the IndexedDB tab. Even reloading the page did not refresh the display. The correct value is shown when using the extension - https://chrome.google.com/webstore/detail/html5-storage-manager-all/giompennnhheakjcnobejbnjgbbkmdnd
(2)
(3)
What is the expected result?
What happens instead?
Please provide any additional information below. Attach a screenshot if
possible.
,
Jan 9 2017
,
Jan 9 2017
Is the mismatch in the "user" field? e.g. provider:anon vs. provider:wx and the rmid/anonId values? I note in the extension screenshot that it's inspecting Storage / Local Storage, not Indexed DB - is that relevant? Are you sure you're inspecting what's actually stored in Indexed DB with the extension? Do you have any steps to reproduce the problem?
,
Jan 23 2017
,
Jan 23 2017
Yes specifically the provider:anon vs provider:wx The extension is supposed to show the IndexedDB data. The indexedDB tab is in BETA so it shows it under the tab that we see in the screenshot. Is there a way to query the value in IndexedDB using any Javascript API to validate what the Dev tools is showing is actually what is in there? I can try running that on the dev console the next time I see the issue happen again. I cannot reproduce this issue at will to be able to provide the steps.
,
Jan 23 2017
Given what I can glean from the screenshot, you'd query it with:
indexedDB.open('twc-web').onsuccess = e => {
const db = e.target.result;
const tx = db.transaction('redux');
tx.objectStore('redux').openCursor().onsuccess = e => {
const cursor = e.target.result;
if (cursor) {
console.log(cursor.key, cursor.value);
cursor.continue();
}
};
};
,
Jan 26 2017
Thanks for the response.. I tried running this on the dev tools console but it did not log anything for me.. It just printed the code inside the onsuccess handler. Please see the attached screenshot. Did you intend for me to run this on chrome dev tools console?
,
Jan 26 2017
Yes, you'd run it on the console. Since not even the console.log('cursor', cursor) is printing anything something strange is going on. Try:
indexedDB.open('twc-web').onsuccess = e => {
console.log('opened');
const db = e.target.result;
const tx = db.transaction('redux');
console.log('created tx');
const request = tx.objectStore('redux').openCursor();
request.onerror = e => {
console.warn(request.error);
};
request.onsuccess = e => {
console.log('success');
const cursor = e.target.result;
console.log('cursor',cursor);
if (cursor) {
console.log(cursor.key, cursor.value);
cursor.continue();
}
};
};
,
Jan 27 2017
Thanks! I was able to figure out the issue with the console logs not working. I am able to get the IndexedDB values using this snippet now.
,
Jan 30 2017
,
Jan 30 2017
Now that you're seeing the values via the logs, are you still seeing a mismatch between what's in the database and what devtools reports even after refresh?
,
Jul 2 2017
I'm seeing some stale data myself. I'm afraid I don't have a reduced test case yet, but in case it helps, here's what I know: I have an app that does a bunch of reads and writes on reload. If I delete the database and reload, I see nothing in the dev tools [as expected]. I refresh the database view, and then the correct data appears. Subsequent reloads do more reads and writes to the database, but refreshing after that shows no changes. Closing the dev tools and reopening them will show the updated data. Ah, more info: if I load, refresh, look at objectStore 1, then reload, refresh, then look at objectStore 2, I see the right data in each at the time I looked. The first time I look at a table, I see what I should, and then it never updates after that until I close the dev dools. So after the above sequence, I'm seeing old data from objectStore 1 alongside new data from objectStore 2.
,
Jul 2 2017
I'm on Version 59.0.3071.47 (Official Build) beta (64-bit) on Linux, BTW.
,
Dec 13 2017
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by nyerramilli@chromium.org
, Jan 5 2017Labels: Needs-Triage-M55