Skip to content

fix(notification): resolve countdown popup repeatedly showing by using reschedule instead of onTimeout - #1778

Draft
18202781743 wants to merge 1 commit into
masterfrom
fix/notification-expiretimer-reschedule
Draft

18202781743 wants to merge 1 commit into
masterfrom
fix/notification-expiretimer-reschedule

Conversation

@18202781743

@18202781743 18202781743 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Root Cause

ExpireTimer::push()/remove()/setBlockId() incorrectly called onTimeout() after modifying the pending entities list. onTimeout() processes expired entries and emits the expired signal, which closes notification bubbles prematurely. When a replacement notification arrives, push() triggers onTimeout(), which closes the current bubble. The next replacement creates a new bubble, resulting in the countdown popup repeatedly appearing.

Fix

Extract the timer-rescheduling logic (stop timer / sort by nearest deadline / start timer) from the end of onTimeout() into a new reschedule() method. Replace onTimeout() calls in push(), remove(), and setBlockId() with reschedule() so the timer is adjusted without triggering premature expiration processing.

onTimeout() itself remains unchanged (still triggered by QTimer::timeout), with its tail calling reschedule().

Related

Summary by Sourcery

Prevent premature notification expiration while updating pending countdown timers.

Bug Fixes:

  • Prevent notification countdown popups from repeatedly reappearing by rescheduling expiration timers without prematurely processing pending notifications.

Enhancements:

  • Separate timer rescheduling from expiration handling so list updates adjust deadlines without emitting expiration events.

…move/setBlockId to prevent repeated popup

When a notification replaces an existing one (push), is removed (remove),
or has its block ID changed (setBlockId), the code incorrectly called
onTimeout(). This caused the timer's timeout handler to fire, which emits
the expired signal for the nearest-deadline notification, closing its
bubble. The bubble then gets re-created, appearing as a repeated popup.

Fix: extract the timer-rescheduling logic from onTimeout() into a new
reschedule() method. Call reschedule() instead of onTimeout() in
push(), remove(), and setBlockId() so the timer is adjusted without
triggering premature expiration.
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR fixes repeatedly appearing countdown popups by ensuring updates to pending expiration entities only reschedule the timer and do not process entries as expired; actual expiration remains handled exclusively by the timer timeout path.

Sequence diagram for notification expiration rescheduling

sequenceDiagram
    participant Notification as Notification
    participant ExpireTimer as ExpireTimer
    participant QTimer as QTimer
    participant Bubble as NotificationBubble

    Notification->>ExpireTimer: push(entity)
    ExpireTimer->>ExpireTimer: reschedule()
    ExpireTimer->>QTimer: start()
    Note over ExpireTimer,Bubble: Pending entities are updated without emitting expired

    QTimer-->>ExpireTimer: timeout()
    ExpireTimer->>ExpireTimer: onTimeout()
    ExpireTimer-->>Bubble: expired(id, bubbleId)
    ExpireTimer->>ExpireTimer: reschedule()
Loading

File-Level Changes

Change Details Files
Separate timer scheduling from expiration processing to prevent notification bubbles from being closed during pending-list updates.
  • Extract nearest-deadline timer stop, sort, and restart logic into reschedule().
  • Use reschedule() after push replacement, entity removal, and block-ID changes instead of invoking onTimeout().
  • Keep expiration handling and expired signal emission tied to QTimer::timeout, with onTimeout() delegating its final scheduling step.
panels/notification/common/expiretimer.cpp
panels/notification/common/expiretimer.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@Ivy233
Ivy233 marked this pull request as draft October 22, 2026 11:52
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.

3 participants