Closed
Bug 1825006
Opened 2 years ago
Closed 2 years ago
FileSystemFileHandle.getFile() returns an object with an incorrect file name
Categories
(Core :: DOM: File, defect)
Tracking
()
RESOLVED
FIXED
113 Branch
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: use-strict, Assigned: jjalkanen)
References
Details
(Keywords: parity-chrome)
Attachments
(2 files)
Steps to reproduce:
await (async () => {
let dir = await navigator.storage.getDirectory();
let handle = await dir.getFileHandle("test.txt", { create: true });
let file = await handle.getFile();
console.log(handle.name); // test.txt
console.log(file.name); // 6NW2MUFR2JJZN5PNB5FZHYHBA4YNR6GLKVG5YJ42QVY5KIY6XVAA
})()
Actual results:
An incorrect file name is returned, probably an internal hash of some sort
Expected results:
The File
object should have the correct file name set (test.txt
)
Comment 1•2 years ago
|
||
This happens indeed and is different from Blink behavior, are we generating a random name here?
Flags: needinfo?(jvarga)
Keywords: parity-chrome
Updated•2 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•2 years ago
|
Severity: -- → S3
Comment 2•2 years ago
•
|
||
I think we need to use a different constructor here: https://searchfox.org/mozilla-central/rev/82828dba9e290914eddd294a0871533875b3a0b5/dom/fs/parent/FileSystemManagerParent.cpp#282
A constructor which also takes a name.
Flags: needinfo?(jvarga) → needinfo?(jjalkanen)
Assignee | ||
Updated•2 years ago
|
Assignee: nobody → jjalkanen
Flags: needinfo?(jjalkanen)
Assignee | ||
Comment 3•2 years ago
|
||
Updated•2 years ago
|
Attachment #9326916 -
Attachment description: WIP: Bug 1825006 - Fix incorrect OPFS file names. r=#dom-storage → Bug 1825006 - Fix incorrect OPFS file names. r=#dom-storage
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D174648
Updated•2 years ago
|
Attachment #9327078 -
Attachment description: Bug 1825006 - Test attributes of OPFS getFile results. r=#dom-storage → Bug 1825006 - Test file names of OPFS getFile results. r=#dom-storage
Updated•2 years ago
|
Attachment #9327078 -
Attachment description: Bug 1825006 - Test file names of OPFS getFile results. r=#dom-storage → Bug 1825006 - Test attributes of OPFS getFile results. r=#dom-storage
Pushed by jjalkanen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ad591d5cd205
Fix incorrect OPFS file names. r=dom-storage-reviewers,saschanaz,janv
https://hg.mozilla.org/integration/autoland/rev/2e885eab12b3
Test attributes of OPFS getFile results. r=saschanaz
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/39408 for changes under testing/web-platform/tests
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ad591d5cd205
https://hg.mozilla.org/mozilla-central/rev/2e885eab12b3
Status: NEW → RESOLVED
Closed: 2 years ago
status-firefox113:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in
before you can comment on or make changes to this bug.
Description
•