Closed Bug 1671625 Opened 4 years ago Closed 4 years ago

IndexedDb viewer in console behaves strangely with an entry with a blank key

Categories

(DevTools :: Storage Inspector, defect, P3)

Firefox 81
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1613356

People

(Reporter: adamson.g, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0

Steps to reproduce:

I created an indexed db and inserted some values with keys, and one with a blank key.

Actual results:

Clicking on the entry with the blank key did not select it
If I clicked on an entry with a key, then the one with the blank key, then another entry with a valid key, I would have multiple keys selected.

Expected results:

The entry with the blank key should have been selected.

Hi adamson.g,
Can you please share with a screen recording or more detailed steps to reproduce this? Not particularly familiar with creating indexdDb and what to inspect in Storage Inspector.

Also moving this to a component so developers can check it out but if you have the time, please elaborate a bit on the steps and how to do this, it is greatly appreciated. Not 100% sure if this is an indexedDB issue or DevTools unless I understand the steps better.
Thank you

Component: Untriaged → Storage: IndexedDB
Flags: needinfo?(adamson.g)
Product: Firefox → Core

AFAIU, this is a DevTools UI issue.

Here is the video, closing and reopening the dev tools is necessary to pick up the new db created by the code I used (stripped down version of the TutorialsPoint example)

Flags: needinfo?(adamson.g)
Component: Storage: IndexedDB → Storage Inspector
Product: Core → DevTools

Thanks :adamson.g for the code and the video, it helps a lot!

Blocks: 1667980
Severity: -- → S3
Priority: -- → P3
Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1284219

Thanks for the report!
I could easily reproduce the problem given the test case on my machine (Win 10, Nightly)

The problem is that the data-table widget [1] is using the key (value in the Key column) to identify the selected row, see [2]. And when the user clicks on a row with no key, the code is executed and the click handler bails out.
https://searchfox.org/mozilla-central/rev/dbced93f1c57942501c23d4633d01ce59d9087a1/devtools/client/storage/ui.js#996-997

It looks like we should provide different data to uniquely identify the row.

[1] https://searchfox.org/mozilla-central/rev/dbced93f1c57942501c23d4633d01ce59d9087a1/devtools/client/shared/widgets/TableWidget.js
[2] https://searchfox.org/mozilla-central/rev/dbced93f1c57942501c23d4633d01ce59d9087a1/devtools/client/shared/widgets/TableWidget.js#158-180

Honza

Has STR: --- → yes
See Also: → 1613356

The bug fix in bug 1613356 also covers this. So I mark this as a duplicate.

Sebastian

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.