Skip to content

Fix single instance lock for macOS sandbox app - #3029

Merged
leaanthony merged 3 commits into
wailsapp:masterfrom
APshenkin:fix/sandbox-app-single-instance
Nov 5, 2023
Merged

leaanthony merged 3 commits into
wailsapp:masterfrom
APshenkin:fix/sandbox-app-single-instance

Conversation

@APshenkin

Copy link
Copy Markdown
Contributor

Description

Recently Single Instance lock was introduced for all platforms. During application implementation I found two issues with case, when MacOs app is launched as sandbox app.

  1. When app is sandboxed os.TempDir() return temp directory, which is not accessible by the app. Changed to native method to get temp directory. It returns proper directory in that case.
  2. In sandboxed app userInfo is not allowed https://developer.apple.com/forums/thread/129437. Fix implemented to pass message via object instead

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • Windows
  • macOS
  • Linux

Test Configuration

Signed application with com.apple.security.app-sandbox enabled

# Wails
Version  | v2.6.0
Revision | a419721dcdf16da7a4afd92b9ba63b2050229a26
Modified | true

# System
┌─────────────────────────┐
| OS           | MacOS    |
| Version      | 13.5.2   |
| ID           | 22G91    |
| Go Version   | go1.20.2 |
| Platform     | darwin   |
| Architecture | arm64    |
└─────────────────────────┘

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@APshenkin

Copy link
Copy Markdown
Contributor Author

@leaanthony Please check this PR. I discovered issues with single instance lock for MacOs and found the way how to fix it. As Single Instance Lock wasn't released still, I didn't put this PR in changelog

@APshenkin

Copy link
Copy Markdown
Contributor Author

BTW, why linter is failing all the time on my PRs, even that I didn't touch these files 😅

@leaanthony leaanthony left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this update @APshenkin 🙏

@leaanthony
leaanthony merged commit 426a569 into wailsapp:master Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants