fix: make all subscriptions resistant to being restarted

many of the errors we've been seeing the last few days are because of subscriptions which are restarting
This commit is contained in:
Ashley Wulber 2024-01-18 21:02:35 -05:00 committed by Ashley Wulber
parent ebe688c747
commit d4e0dd8fb8
12 changed files with 184 additions and 138 deletions

View file

@ -22,7 +22,7 @@ pub enum State {
Finished,
}
pub fn notifications() -> Subscription<Notification> {
pub fn notifications(proxy: NotificationsAppletProxy<'static>) -> Subscription<Notification> {
struct SomeWorker;
subscription::channel(
@ -107,7 +107,7 @@ trait NotificationsApplet {
) -> zbus::Result<()>;
}
async fn get_proxy() -> anyhow::Result<NotificationsAppletProxy<'static>> {
pub async fn get_proxy() -> anyhow::Result<NotificationsAppletProxy<'static>> {
let raw_fd = std::env::var("COSMIC_NOTIFICATIONS")?;
let raw_fd = raw_fd.parse::<RawFd>()?;