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

Incorrect signals being sent when any notification is resolved in proxy mode #2

Open
muhchaudhary opened this issue May 30, 2024 · 1 comment

Comments

@muhchaudhary
Copy link

I've noticed that when using AstalNotifd in proxy mode, dismissing/resolving any single notification will collectively send a resolved signal for all current notifications.

Steps to reproduce:

  1. Start the notification daemon in a seperate terminal (astal-notifd -d)
  2. Start AstalNotifd.Notifd.new() (This will start in proxy mode)
  3. send multiple notifications (example: notify-send "Hello World" followed by notify-send "Hello World -t 1000")
@Aylur
Copy link
Contributor

Aylur commented Jun 2, 2024

cant reproduce, are you sure you are not calling dismiss yourself somewhere?

This is what I did and it works as expected

import Notifd from "gi://AstalNotifd"
import GLib from "gi://GLib"

const notifd = new Notifd.Notifd

notifd.connect("notified", (_, id) => {
    print("notifd", notifd.get_notification(id).summary)
})

notifd.connect("resolved", (_, id) => {
    print("resolved", id)
})

new GLib.MainLoop(null, false).run()
❯  astal-notifd -d
{"id":1,"time":1717343017,"expire_timeout":-1,"app_name":"notify-send","app_icon":"","summary":"hello world","body":"","actions":[],"hints":{"urgency":1,"sender-pid":507830}}
{"id":2,"time":1717343017,"expire_timeout":-1,"app_name":"notify-send","app_icon":"","summary":"hello world","body":"","actions":[],"hints":{"urgency":1,"sender-pid":507952}}
{"id":3,"time":1717343018,"expire_timeout":-1,"app_name":"notify-send","app_icon":"","summary":"hello world","body":"","actions":[],"hints":{"urgency":1,"sender-pid":508000}}
{"id":4,"time":1717343024,"expire_timeout":1000,"app_name":"notify-send","app_icon":"","summary":"hello world","body":"","actions":[],"hints":{"urgency":1,"sender-pid":508299}}
❯  gjs test.js
notifd hello world
notifd hello world
notifd hello world
notifd hello world
resolved 4
notify-send "hello world"
notify-send "hello world"
notify-send "hello world"
notify-send "hello world" -t 1000

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

No branches or pull requests

2 participants