https://bugs.kde.org/show_bug.cgi?id=495974

Fushan Wen <qydwhotm...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/plasma-activities-stats/
                   |                            |-/commit/8a4731b811f322e93c
                   |                            |3c6e3e15ceda7214184620
         Resolution|---                         |FIXED
             Status|CONFIRMED                   |RESOLVED

--- Comment #7 from Fushan Wen <qydwhotm...@gmail.com> ---
Git commit 8a4731b811f322e93c3c6e3e15ceda7214184620 by Fushan Wen, on behalf of
David Edmundson.
Committed on 09/01/2025 at 13:04.
Pushed by fusionfuture into branch 'master'.

Avoid nested event processing waiting for DBus queries.


If a plasma-activity-stats queries can reference the current activity
which involves loading from the running daemon. This is typically async
and cached.

If the daemon has not yet loaded or no event loop is running the current
code blocks to wait for a response.

The current code could work processEvents only handles the main thread
not the DBus thread. If we need to wait for a DBus result the right
action in this situation is a blocking DBus call.

Nested event processing is always a terrible anti-pattern and even if it
did work properly can lead to all sorts of issues elsewhere.

To avoid blocking calls in long-running applications which will re-run
queries when the activity changes anyway, it is guarded to only make
blocking calls for headless apps.

M  +25   -8    src/activitiessync_p.cpp

https://invent.kde.org/plasma/plasma-activities-stats/-/commit/8a4731b811f322e93c3c6e3e15ceda7214184620

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to