Skip to content

fix(notifications): do not show battery notification when already charging - #3045

Open
marcinjahn wants to merge 1 commit into
AvengeMedia:masterfrom
marcinjahn:battery-double-notif
Open

fix(notifications): do not show battery notification when already charging#3045
marcinjahn wants to merge 1 commit into
AvengeMedia:masterfrom
marcinjahn:battery-double-notif

Conversation

@marcinjahn

@marcinjahn marcinjahn commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

I had a case where:

  1. Laptop wasn't charging, it was working on battery
  2. Battery fell to 20%
  3. I got the notification about battery being low, asking me to charge (good)
  4. I connected a charger
  5. After short time I got the same notification again (bad)

This should fix it.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

Screenshots / video

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dlx-docs to document any new behaviors: https://github.com/AvengeMedia/DankLinux-Docs

…rging

I had a case where:

1. Laptop wasn't charging, it was working on battery
2. Battery fell to 20%
3. I got the notification about battery being low, asking me to charge (good)
4. I connected a charger
5. After short time I got the same notification again (bad)

This should fix it.
@Purian23

Copy link
Copy Markdown
Collaborator

The race diagnosis makes sense, though this introduces a five-second grace window around the AC transition. We generally prefer reacting to the underlying power/UPower state changes rather than relying on timing where possible. Is the grace period needed because there isn’t a reliable follow-up event we can key off here, or could this be resolved when the relevant battery/charging state update arrives instead?

I've personally not ran into this one before. Once I plug in AC charging the status is satisfied.

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.

2 participants