Phosh 0.28.0 wakes up screen from "suspend soon" notifications

Describe your issue

Phosh 0.28.0 wakes up the screen for "critical" notifications. Unfortunately the "going to auto-suspend soon" notification is marked as critical and makes it wake up, in my observation effectively blocking suspend altogether. I'm not sure in which component the problem originates from a pmOS point of view. My gut feeling says it's gsd-power, which sends the notification with an inappropriate (and not configurable) urgency, even with power notifications disabled in settings. I guess one could also argue Phosh needs a better notification filter.

What's the expected behaviour?

If the phone is not actively used, it should suspend after the configured inactivity time passes.

What's the current behaviour?

About a minute before the expected suspend the screen turns on with a notification from gsd-power that the device will suspend soon due to inactivity. It doesn't actually suspend (my guess is that the timer resets when the screen is turned on).

How to reproduce your issue?

Enable automatic suspend (ideally with a short timeout), turn off the screen, leave the phone within sight. You'll see the screen turn on every few minutes (depending on the timeout).

What device are you using?

pine64-pinephone revision 1.2b

On what postmarketOS version did you encounter the issue?

  • edge (master branch)

  • v23.06

  • v22.12 (Supported until 2023-07-06)

  • I confirm that the issue still is present after running sudo apk upgrade -a

On what environment did you encounter the issue?

Environments

  • GNOME Shell on Mobile
  • Phosh
  • Plasma Mobile
  • Sxmo (Wayland/Sway) Please post the output of sxmo_version.sh
  • Other: Please fill out

How did you get postmarketOS image?

Additional information

I used dbus-monitor to pinpoint the origin and properties of the power notification, and it's gsd-power (checked from the sender-pid). Text in the capture below is in the German localization. Note that the urgency is marked "critical" (2).

method call time=1687203788.038304 sender=:1.32 -> destination=:1.13 serial=860 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "Energie"
   uint32 0
   string ""
   string "Automatisch in den Bereitschaftsmodus wechseln"
   string "Aufgrund von Inaktivität wird bald in Bereitschaft versetzt."
   array [
   ]
   array [
      dict entry(
         string "desktop-entry"
         variant             string "gnome-power-panel"
      )
      dict entry(
         string "x-gnome-privacy-scope"
         variant             string "system"
      )
      dict entry(
         string "urgency"
         variant             byte 2
      )
      dict entry(
         string "sender-pid"
         variant             int64 3346
      )
   ]
   int32 0

Workaround

Disable the screen wakeup altogether (see Phosh wiki):

gsettings set sm.puri.phosh.notifications wakeup-screen-triggers '[]'

Note that the command must be run with access to the DBus session bus from the UI session.

Edited by Airtower