Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: honor user-defined Downloads directory #29938

Merged
merged 1 commit into from Jun 30, 2021
Merged

Conversation

codebytere
Copy link
Member

Description of Change

Closes #29909.

Makes it such that ElectronBrowserClient::GetDefaultDownloadDirectory() honors user-defined Downloads directories by calling out to platform-specific download logic defined in Chromium

Checklist

Release Notes

Notes: Fixes an issue where Electron would sometimes not honor the user-defined Downloads directory.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 29, 2021
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/13-x-y labels Jun 29, 2021
Copy link
Member

@nornagon nornagon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test? 😇

shell/browser/electron_browser_client.cc Outdated Show resolved Hide resolved
@codebytere
Copy link
Member Author

@nornagon what would you envision for a test here? Our session downloader shows a dialog if a user doesn't explicitly set the save path, and all calls to GetDefaultDownloadDirectory originate from Chromium so i'm not sure how to explicitly trigger that codepath via test 🤔

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 30, 2021
@nornagon
Copy link
Member

Ah, okay, I wasn't sure if there was a way to interrogate this value without user interaction. There's app.getPath('downloads') but it seems like that doesn't go through the same code path.

@codebytere
Copy link
Member Author

Unrelated failure.

@codebytere codebytere merged commit 98809d8 into main Jun 30, 2021
@codebytere codebytere deleted the honor-download-paths branch June 30, 2021 20:54
@release-clerk
Copy link

release-clerk bot commented Jun 30, 2021

Release Notes Persisted

Fixes an issue where Electron would sometimes not honor the user-defined Downloads directory.

@trop
Copy link
Contributor

trop bot commented Jun 30, 2021

I have automatically backported this PR to "12-x-y", please check out #29966

@trop
Copy link
Contributor

trop bot commented Jun 30, 2021

I have automatically backported this PR to "14-x-y", please check out #29967

@trop
Copy link
Contributor

trop bot commented Jun 30, 2021

I have automatically backported this PR to "13-x-y", please check out #29968

BlackHole1 pushed a commit to BlackHole1/electron that referenced this pull request Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: GetDefaultDownloadDirectory doesn't honour the user-defined Downloads directory
2 participants