Closed michelcrypt4d4mus closed 5 months ago
Did some additional digging into what might be causing the issue... I know launchd
is finicky and I stumbled upon this discussion of issues with python fork()
in macOS as well as similar discussions for ruby and php having to do with some recent macOS changes... however setting OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
did not seem to fix my issue with the unpatched version of this package.
So... this actually doesn't quite work. It works great... once. The next time it fails with:
error: MacOSNotification is overriding existing Objective-C class
This is because every call to notification_sender.create_notification()
redefines the class MacOSNotification
. In your implementation this isn't a problem because you are forking a process and there's no collision, but in my situation that's no bueno.
So I pulled the MacOSNotification
class outside of the function over on another branch (that also includes the sound
parameter, sorry) and it works great. However I have not tested it with any kind of callback as per the usual setup.
Closing this because it's not a valid fix.
This is a pretty horrible and hacky workaround so I'm not sure you should actually merge this pull request but I figured it would be helpful for you to to see the v. limited changed I needed to get your code to work in the context of being run from a server or daemon. Maybe you have some better ideas about how to go about actually implementing this in your codebase? Happy to help.
See discussion