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

[MM-47801][MM-45980] Added support for security-scoped bookmarks to allow the MAS build to save files wherever needed #2315

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

devinbinnie
Copy link
Member

Summary

Because of Apple's App Sandbox, saving files in any location other than the Downloads directory causes a number of issues. In order to resolve these, Apple provides an API called "security-scoped bookmarks" that allows an app to temporarily gain access to a file in the same way that the user would normally pick one using the dialog box and do some work on it.

This PR converts the downloads code to allow for these bookmarks to be created and stored in a persistent manner so that MAS build users can access and save files as normal. This approach conveniently also fixes the issue where users couldn't replace files.

Ticket Link

https://mattermost.atlassian.net/browse/MM-47801
https://mattermost.atlassian.net/browse/MM-45980
Closes #2199

Fixed an issue where MAS users couldn't easily replace files.

@devinbinnie devinbinnie added 2: Dev Review Requires review by a core committer CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Oct 24, 2022
@devinbinnie devinbinnie added this to the v5.2.0 milestone Oct 24, 2022
@devinbinnie devinbinnie requested review from m1lt0n and tboulis October 24, 2022 22:31
Copy link
Contributor

@m1lt0n m1lt0n left a comment

Choose a reason for hiding this comment

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

Awesome PR!

Copy link
Contributor

@tboulis tboulis left a comment

Choose a reason for hiding this comment

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

Looks good to me @devinbinnie !!
Thanks for taking care of this <3

@tboulis tboulis merged commit 635a41f into mattermost:master Oct 25, 2022
@mattermod
Copy link
Contributor

Cherry pick is scheduled.

mattermost-build pushed a commit to mattermost-build/desktop that referenced this pull request Oct 25, 2022
…llow the MAS build to save files wherever needed (mattermost#2315)

* First pass

* [MM-47801] Added support for security-scoped bookmarks to allow the MAS build to save files wherever needed

(cherry picked from commit 635a41f)
@mattermod mattermod added CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone and removed CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels Oct 25, 2022
tboulis pushed a commit that referenced this pull request Oct 25, 2022
…llow the MAS build to save files wherever needed (#2315) (#2316)

* First pass

* [MM-47801] Added support for security-scoped bookmarks to allow the MAS build to save files wherever needed

(cherry picked from commit 635a41f)

Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client does not overwrite pre-existing file on download from a chat
5 participants