Handle OPFS entries renamed with database manager version 001
Categories
(Core :: DOM: File, defect, P1)
Tracking
()
People
(Reporter: janv, Assigned: jari)
References
Details
Attachments
(1 file, 1 obsolete file)
|
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
Database manager version 001 doesn't rehash files or directories on rename, unique EntryIds are generated instead if there are collisions. Database manager version 002 started doing the rehashing, but the upgrade from version 001 to version 002 doesn't rehash all the files and directories, so if an entry is accessed with database manager version 002 which was previously renamed, the code tries to insert the same EntryId into Entries and Files tables. There are several options how to fix this problem:
- Rehash everything during the existing upgrade
- Rehash everything during a new upgrade (a new version would be introduced)
Allow generation of unique EntryIds in database manager version 002
| Reporter | ||
Comment 1•2 years ago
|
||
| Reporter | ||
Comment 2•2 years ago
|
||
Jari and I analyzed the options I described in comment 0 and we concluded that option 3 isn't a good solution, apps which move files could still experience problems. Jari is now working on the "rehashing everything" solution.
| Assignee | ||
Comment 3•2 years ago
|
||
Depends on D185429
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 5•2 years ago
|
||
Please nominate this for Beta approval as soon as you're comfortable doing so.
Comment 6•2 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 7•2 years ago
|
||
Comment on attachment 9349204 [details]
Bug 1848916 - Ensure EntryId corresponds to path for OPFS schema 002. r=#dom-storage
Beta/Release Uplift Approval Request
- User impact if declined: Web Photoshop users cannot save or edit their preferences. Other applications may be experience data corruption when file handles which have been moved or renamed and saved in serialized form are used after a migration.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce: There has already been manual testing at least four people.
- In a new profile, Edit a file using 115 (log into PS, select a file to edit).
- Save.
- Wait until the cloud icon (center top) goes back to just a cloud.
- Exit (should be no warnings).
- Load new build with that profile.
- Restore previous session (loads the file).
- Make any edit to it.
- Save. There should be no errors reported; cloud icon should indicate save completed.
- Repeat, but inbetween 115 and the new build, try to load the file in 116.0.2. (I.e. create a corrupt profile).
- The file will fail to finish loading.
- Repeat, but inbetween 115 and the new build, try to load the file in 116.0.3.
- The file should load and be editable. However saving will throw two errors.
- The save appears to complete.
- And for good measure, in a new profile use the new build to edit and save a file
- List of other uplifts needed: -
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): The patch restores the integrity of the data or falls back to the previous state. It is composed of previously used programming constructs. The code path has been throroughly tested by the incident team and there is an automated test which will be landed later because it requires certain infrastructure changes.
The alternative considered is to forget the old user data and start from an empty OPFS profile.
- String changes made/needed: -
- Is Android affected?: Yes
Comment 8•2 years ago
|
||
Comment on attachment 9349204 [details]
Bug 1848916 - Ensure EntryId corresponds to path for OPFS schema 002. r=#dom-storage
Approved for 117.0b9.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 10•2 years ago
|
||
I tested the scenarios from comment 7 using both latest Nightly and Firefox 117.0b9 across platforms (Windows 10, macOS 13 and Ubuntu 18.04) and I found no issues/errors on my side as well.
Description
•