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

Ensure notification service is available when sending a notification #720

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

davfsa
Copy link
Contributor

@davfsa davfsa commented Jan 12, 2025

This is a bit of a weird patch for a fundamental order-of-execution issue.

The bundler (esbuild) can sometimes place the notifdService instantiation bellow the code calling Notify, which would causes the notify-send execution to fail. To avoid this, we can make it seem like notifdService is being used inside Notify, so that it is always placed above the usage of the function, ensuring that we always have a notification daemon running


This issue has become apparent to me as I have upgraded Hyprpanel, as sometimes the "swww is a missing dependency" notification would sometimes show up on startup and sometimes not (it would depend on where the bundler would place the piece of code).

Additionally, this will allow #684 to send notifications when creating the configuration, for the same reason as listed above.


If anybody knows a better way to indicate to the bundler to always place src/lib/constants/services.ts at the top of the bundle, then that would be a way better fix, but I have been unable to find a way to do it

This is a bit of a weird patch for a fundamental order-of-execution
issue.

The bundler (esbuild) can sometimes place the `notifdService`
instantiation bellow the code calling `Notify`, which would causes the
`notify-send` execution to fail. To avoid this, we can make it seem like
`notifdService` is being used inside `Notify`, so that it is always
placed above the usage of the function, ensuring that we always have a
notification daemon running
@davfsa davfsa force-pushed the task/ensure-notify branch from 2de86c7 to d018ab2 Compare January 12, 2025 18:32
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.

1 participant