Closed Bug 1802278 Opened 2 years ago Closed 2 years ago

Return invalid modification error when trying to overwrite locked files

Categories

(Core :: DOM: File, defect, P3)

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: jjalkanen, Assigned: jjalkanen)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

According to comment

  // XXX Note: the spec doesn't mention this case.  The WPT tests assume
  // that you can overwrite using move().

  // If the destination file exists, fail explicitly.  Spec author plans to
  // revise the spec

in the dom/fs/parent/datamodel/FileSystemDatabaseManagerVersion001.cpp file,
OPFS implementation disallows all overwrites but in such a case, for web compatibility,, according to web platform tests

  [move(dir) while the destination file has an open writable fails]
  [move(dir, name) while the destination file has an open writable fails]

we should check if the destination is locked and return the appropriate error before the custom error case.

OPFS disallows all overwrites but for web compatibility,
but in such a case, according to web platform tests
[move(dir) while the destination file has an open writable fails]
[move(dir, name) while the destination file has an open writable fails]
we should check if the destination is locked and return the appropriate error.

Blocks: OPFS
Attachment #9305064 - Attachment description: Bug 1802278 - Return invalid modification when trying to overwrite locked files. r=#dom-storage → Bug 1802278 - Return modification not allowed when trying to overwrite locked files. r=#dom-storage
Pushed by jjalkanen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cf343ab21f9b Return modification not allowed when trying to overwrite locked files. r=dom-storage-reviewers,jesup

Backed out for causing wpt failures on FileSystemFileHandle-move.https.any.worker.html.

Push with failures

Failure log

Backout link

[task 2022-12-07T12:40:45.385Z] 12:40:45     INFO - TEST-START | /fs/FileSystemFileHandle-move.https.any.worker.html
[task 2022-12-07T12:40:45.416Z] 12:40:45     INFO - Closing window 62c60ae1-48a0-4c84-9129-ecebe7293008
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - 
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-FAIL | /fs/FileSystemFileHandle-move.https.any.html | move(dir, name) while the destination file has an open writable fails - promise_test: Unhandled rejection with value: object "[Exception... "Method not implemented"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: https://web-platform.test:8443/fs/resources/test-helpers.js :: createFileWithContents :: line 77"  data: no]"
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-FAIL | /fs/FileSystemFileHandle-move.https.any.html | FileSystemFileHandles are references, not paths - promise_test: Unhandled rejection with value: object "[Exception... "Method not implemented"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: https://web-platform.test:8443/fs/resources/test-helpers.js :: createFileWithContents :: line 77"  data: no]"
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(name) to rename a file 
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | get a handle to a moved file 
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(name) to rename a file the same name 
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move("") to rename a file fails 
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(name) can be called multiple times 
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-FAIL | /fs/FileSystemFileHandle-move.https.any.worker.html | move(name) with a name with a trailing period should fail - assert_unreached: Should have rejected: undefined Reached unreachable code
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(name) with a name with invalid characters should fail 
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(name) while the file has an open writable fails 
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-UNEXPECTED-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(name) while the destination file has an open writable fails - expected FAIL
[task 2022-12-07T12:40:48.053Z] 12:40:48     INFO - TEST-INFO | expected FAIL
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir, name) to rename a file 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir, name) to rename a file the same name 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir) to move a file to a new directory 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir, "") to move a file to a new directory fails 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir, name) to move a file to a new directory 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir) can be called multiple times 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir, name) can be called multiple times 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir, name) with a name with invalid characters should fail 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir) while the file has an open writable fails 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir, name) while the file has an open writable fails 
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-UNEXPECTED-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir) while the destination file has an open writable fails - expected FAIL
[task 2022-12-07T12:40:48.057Z] 12:40:48     INFO - TEST-INFO | expected FAIL
[task 2022-12-07T12:40:48.058Z] 12:40:48     INFO - 
[task 2022-12-07T12:40:48.058Z] 12:40:48     INFO - TEST-UNEXPECTED-PASS | /fs/FileSystemFileHandle-move.https.any.worker.html | move(dir, name) while the destination file has an open writable fails - expected FAIL
[task 2022-12-07T12:40:48.058Z] 12:40:48     INFO - TEST-INFO | expected FAIL
[task 2022-12-07T12:40:48.127Z] 12:40:48     INFO - TEST-OK | /fs/FileSystemFileHandle-move.https.any.worker.html | took 2742ms
[task 2022-12-07T12:40:48.849Z] 12:40:48     INFO - STDOUT: cleanup aborted: args: /builds/worker/fetches/android-sdk-linux/platform-tools/adb wait-for-device shell rm /data/data/org.mozilla.geckoview.test_runner/files/mozilla/profiles.ini; echo adb_returncode=$?, exitcode: 1, stdout: rm: /data/data/org.mozilla.geckoview.test_runner/files/mozilla/profiles.ini: No such file or directory
[task 2022-12-07T12:40:48.850Z] 12:40:48     INFO - Closing logging queue
[task 2022-12-07T12:40:48.850Z] 12:40:48     INFO - queue closed
[task 2022-12-07T12:40:48.861Z] 12:40:48     INFO - Setting up ssl
[task 2022-12-07T12:40:48.876Z] 12:40:48     INFO - certutil | b''
[task 2022-12-07T12:40:48.890Z] 12:40:48     INFO - certutil | b''
[task 2022-12-07T12:40:48.898Z] 12:40:48     INFO - certutil | b'\nCertificate Nickname                                         Trust Attributes\n                                                             SSL,S/MIME,JAR/XPI\n\nweb-platform-tests                                           CT,, \n'
[task 2022-12-07T12:40:54.193Z] 12:40:54     INFO - STDOUT: timed out waiting for profiles.ini
[task 2022-12-07T12:40:54.305Z] 12:40:54     INFO - adb Granting important runtime permissions to org.mozilla.geckoview.test_runner
[task 2022-12-07T12:40:55.511Z] 12:40:55     INFO - adb launch_application: am start -W -n org.mozilla.geckoview.test_runner/org.mozilla.geckoview.test_runner.TestRunnerActivity -a android.intent.action.MAIN --es env0 MOZ_CRASHREPORTER=1 --es env1 MOZ_CRASHREPORTER_NO_REPORT=1 --es env2 MOZ_CRASHREPORTER_SHUTDOWN=1 --es env3 MOZ_HIDE_RESULTS_TABLE=1 --es env4 MOZ_IN_AUTOMATION=1 --es env5 MOZ_LOG=signaling:3,mtransport:4,DataChannel:4,jsep:4 --es env6 R_LOG_LEVEL=6 --es env7 R_LOG_DESTINATION=stderr --es env8 R_LOG_VERBOSE=1 --es env9 MOZ_PROCESS_LOG=/tmp/tmpcgtav50xpidlog --es env10 MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 --es env11 STYLO_THREADS=1 --es arg0 -no-remote --es arg1 -profile --es arg2 /data/local/tmp/test_root/profile --es arg3 --marionette --es arg4 about:blank --ez use_multiprocess True
[task 2022-12-07T12:40:56.793Z] 12:40:56     INFO - Starting runner
[task 2022-12-07T12:40:59.804Z] 12:40:59     INFO - TEST-START | /fs/FileSystemFileHandle-sync-access-handle-writable-lock.https.tentative.worker.html
Flags: needinfo?(rjesup)
Flags: needinfo?(jjalkanen)
Pushed by jjalkanen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dc982f524893 Return modification not allowed when trying to overwrite locked files. r=dom-storage-reviewers,jesup
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch

This issue is now fixed.

Flags: needinfo?(rjesup)
Flags: needinfo?(jjalkanen)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: