electron
electron copied to clipboard
[Bug]: MAS builds do not allow overwriting of downloaded file to non-excepted directories
Preflight Checklist
- [X] I have read the Contributing Guidelines for this project.
- [X] I agree to follow the Code of Conduct that this project adheres to.
- [X] I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
19.0.6
What operating system are you using?
macOS
Operating System Version
macOS Monterey 12.4
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
Unknown, reproduces since at least v18 Reproduced on v18, v19 and v20.
Expected Behavior
- Click on a link that will fire the
will-download
event. - You should see a dialog pop up as to where to save the file. Select a file that already exists.
- The user is prompted to replace the file. Select Replace.
- The file is successfully replaced on the drive.
Actual Behavior
Instead of the file being replaced, the download state changed to interrupted
after the file transfer is complete.
The file is not replaced and remains in its original state.
Testcase Gist URL
No response
Additional Information
This only reproduces on MAS builds. I've been generating them using electron-builder
. I can try and come up with a Gist if that would be helpful.
I added the required entitlement com.apple.security.files.user-selected.read-write
which allows me to read and write files, but apparently replacing them does not work.
HOWEVER, if you add the specific entitlements for special folders in the users (eg. com.apple.security.files.downloads.read-write
) it will allow you to replace files in the specified folder and will not cause the download to be interrupted
.
I'm guessing something's a little wonky with the permissions for replacing files with the user-selected
entitlement.