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

Apple Store package not starting on MacOS Silicon; DMG works fine #3938

Closed
andrewgdotcom opened this issue Jun 14, 2024 · 14 comments · Fixed by #3946
Closed

Apple Store package not starting on MacOS Silicon; DMG works fine #3938

andrewgdotcom opened this issue Jun 14, 2024 · 14 comments · Fixed by #3946
Labels
blocker This issue is blocking a new release bug Something isn't working OS: Mac Related to MacOS

Comments

@andrewgdotcom
Copy link

  • Operating System (Linux/Mac/Windows/iOS/Android): MacOS 13.6 on Apple Silicon
  • Delta Chat Version: 1.44.1 App Store
  • Expected behavior: Should start
  • Actual behavior: Icon bounces for a few moments in the dock and then stops.
  • Steps to reproduce the problem: Run the app
  • Screenshots: None, nothing appears
  • Logs: None that I can find...

Downloading the DMG and installing the old-fashioned way works without problems.

@Simon-Laux
Copy link
Member

please try again with 1.46.0, should already be in the appstore:
Bildschirmfoto 2024-06-15 um 16 16 13

@Simon-Laux
Copy link
Member

reopen / notify us if this issue if it still happens on the current/new 1.46 version.

@andrewgdotcom
Copy link
Author

andrewgdotcom commented Jun 15, 2024

It's even worse with 1.46, it fails immediately rather than after 20s. Again nothing particularly informative in the logs:

error 16:27:19.298522+0100 DeltaChat <SKPaymentQueue: 0x12400064c00>: No observers found that respond to "paymentQueue:shouldAddStorePayment:forProduct:", will not check for purchase intents
default 16:27:19.298892+0100 storekitagent StoreKitServiceListener: Accepting new connection (DeltaChat) <NSXPCConnection: 0x13ab914e0> connection from pid 62913 on mach service named com.apple.storekitagent
default 16:27:19.299464+0100 DeltaChat NSApp cache appearance:
-NSRequiresAquaSystemAppearance: 0
-appearance: (null)
-effectiveAppearance: <NSCompositeAppearance: 0x104002e5280
 (
    "<NSAquaAppearance: 0x104002e5200>",
    "<NSSystemAppearance: 0x104002e3b00>"
)>
default 16:27:19.315249+0100 storekitagent [Client] (DeltaChat) Initialized with server Production bundle ID chat.delta.desktop.electron and request bundle ID chat.delta.desktop.electron]
default 16:27:19.327752+0100 storekitagent [Client] (DeltaChat) Initialized with server Production bundle ID chat.delta.desktop.electron and request bundle ID chat.delta.desktop.electron]
default 16:27:19.328353+0100 DeltaChat sf changed: <private>
default 16:27:19.331094+0100 DeltaChat Entering exit handler.
default 16:27:19.331118+0100 DeltaChat Queueing exit procedure onto XPC queue. Any further messages sent will be discarded. activeSendTransactions=0
default 16:27:19.331162+0100 DeltaChat Cancelling XPC connection. Any further reply handler invocations will not retry messages
default 16:27:19.331182+0100 DeltaChat Exiting exit handler.
default 16:27:19.331197+0100 DeltaChat XPC connection invalidated (daemon unloaded/disabled)
error 16:27:19.331207+0100 DeltaChat No error handler for XPC error: <private>
default 16:27:19.389427+0100 storekitagent [Client] (DeltaChat) Initialized with server Production bundle ID chat.delta.desktop.electron and request bundle ID chat.delta.desktop.electron]
default 16:27:19.391736+0100 storekitagent StoreKitServiceListener: Connection to DeltaChat invalidated
default 16:27:19.409693+0100 loginwindow -[PersistentAppsSupport applicationQuit:] | for app:DeltaChat, _appTrackingState = 2
default 16:27:19.409729+0100 loginwindow -[PersistentAppsSupport applicationQuit:] | App: DeltaChat, quit, updating active tracking timer

@Simon-Laux Simon-Laux reopened this Jun 17, 2024
@Simon-Laux Simon-Laux added bug Something isn't working OS: Mac Related to MacOS blocker This issue is blocking a new release labels Jun 17, 2024
@Simon-Laux
Copy link
Member

It's even worse with 1.46, it fails immediately rather than after 20s

failing fast is way better than taking 20s to fail.

@Simon-Laux
Copy link
Member

Simon-Laux commented Jun 17, 2024

Would be interesting to know if sth useful comes up if you start it from the terminal:

/Applications/DeltaChat.app/Contents/MacOS/DeltaChat -- --log-to-console

@andrewgdotcom
Copy link
Author

[46167:0617/091904.726617:ERROR:process_singleton_posix.cc(1170)] Failed to bind() /var/folders/3z/tztp1x4d1h50t062180j3qd40000gn/T/chat.delta.desktop.electron/S/SingletonSocket: Operation not permitted (1)
Only one instance allowed. Quitting.

@Simon-Laux
Copy link
Member

seems to be electron/electron#35540

solutions might be:
A. ignore single instance stuff on macOS entirely (might result in other bugs)
B. make our own implementation for a single instance lock (atleast on macOS)
C. remove com.apple.security.app-sandbox entitlement

@Simon-Laux
Copy link
Member

For the record, it works fine on macOS Sonoma 14.3.1, just tested the version from appstore. So this only appears on some versions.

@Simon-Laux
Copy link
Member

/me misclicked

@Simon-Laux
Copy link
Member

C. remove com.apple.security.app-sandbox entitlement

To distribute a macOS app through the Mac App Store, you must enable the App Sandbox capability.
~ https://developer.apple.com/documentation/security/app_sandbox

So option C is not possible

@Simon-Laux
Copy link
Member

@andrewgdotcom
Copy link
Author

@Simon-Laux no results 🤷

@andrewgdotcom
Copy link
Author

Neither subsystem:com.apple.sandbox.reporting nor category:violation produce any results, even by themselves

@Simon-Laux
Copy link
Member

On macOS, the system enforces single instance automatically when users try to open a second instance of your app in Finder, and the open-file and open-url events will be emitted for that. However when users start your app in command line, the system's single instance mechanism will be bypassed, and you have to use this method to ensure single instance.
~ electron docs https://www.electronjs.org/docs/latest/api/app#apprequestsingleinstancelockadditionaldata

so I guess we can just skip that single instance lock on macOS appstore builds, it will probably fail on the account manager lockfile in core then, but only if users try to open it via the commandline

Simon-Laux added a commit that referenced this issue Jun 17, 2024
…e it made it unable to start the app on older macOS devices.

closes #3938
Simon-Laux added a commit that referenced this issue Jun 17, 2024
…e it made it unable to start the app on older macOS devices. (#3946)

* skip `requestSingleInstanceLock` on mac appstore builds (mas), because it made it unable to start the app on older macOS devices.

closes #3938

* Add pr number to changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker This issue is blocking a new release bug Something isn't working OS: Mac Related to MacOS
Projects
None yet
2 participants