Skip to content

fix(linux): run notify and acknowledge async#141

Merged
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
Kishi85:run-notify-async-in-eventloop
Jun 5, 2026
Merged

fix(linux): run notify and acknowledge async#141
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
Kishi85:run-notify-async-in-eventloop

Conversation

@Kishi85

@Kishi85 Kishi85 commented May 31, 2026

Copy link
Copy Markdown

Description

This is a new attempt to run tray notify and acknowledge async to avoid blocked DBus function calls that cause issues in implementors of this library.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@Kishi85 Kishi85 force-pushed the run-notify-async-in-eventloop branch from 860badc to 6d368cf Compare May 31, 2026 16:38
@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.07407% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.98%. Comparing base (84e46f1) to head (afc9ced).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/tray_linux.cpp 74.07% 5 Missing and 9 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #141      +/-   ##
==========================================
+ Coverage   63.60%   63.98%   +0.38%     
==========================================
  Files           5        5              
  Lines         621      647      +26     
  Branches      200      214      +14     
==========================================
+ Hits          395      414      +19     
- Misses        152      153       +1     
- Partials       74       80       +6     
Flag Coverage Δ
Linux-qt5 54.03% <74.07%> (+1.14%) ⬆️
Linux-qt6 54.03% <74.07%> (+1.14%) ⬆️
Windows 70.67% <ø> (+0.48%) ⬆️
macOS 58.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/tray_linux.cpp 62.16% <74.07%> (+1.50%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84e46f1...afc9ced. Read the comment docs.

@github-actions

github-actions Bot commented May 31, 2026

Copy link
Copy Markdown
Last Updated 2026-06-05 12:38:13 UTC
Source Run CI Run #654
Commit afc9cedafebfc6ddffa6a94b1a95847074b70c38

Screenshot Comparison

PR #141 screenshots vs screenshots baseline.

Matrix: Linux-qt5

Image Baseline PR
tray_icon_initial.png
tray_icon_svg.png
tray_icon_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_displayed.png
tray_notification_themed_icon.png

Matrix: Linux-qt6

Image Baseline PR
tray_icon_initial.png
tray_icon_svg.png
tray_icon_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_displayed.png
tray_notification_themed_icon.png

Matrix: Windows

Image Baseline PR
tray_icon_initial.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_shown.png
tray_notification_displayed.png

Matrix: macOS

Image Baseline PR
tray_icon_initial.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_shown.png
tray_notification_displayed.png

@Kishi85

Kishi85 commented May 31, 2026

Copy link
Copy Markdown
Author

Screenshots look pretty broken with this unfortunately. This might take a while to figure out properly.

@ReenigneArcher

Copy link
Copy Markdown
Member

Screenshots look pretty broken with this unfortunately. This might take a while to figure out properly.

I think it's just not cleaning up between each test.

@Kishi85 Kishi85 force-pushed the run-notify-async-in-eventloop branch from 6d368cf to 67d4cdb Compare May 31, 2026 19:25
@Kishi85 Kishi85 changed the title fix(linux): run notify and acknowledge in async in event loop fix(linux): run notify and acknowledge in async May 31, 2026
@Kishi85

Kishi85 commented May 31, 2026

Copy link
Copy Markdown
Author

I've changed this back to my first attempt at this (reverted in #135) with some additional changes to thread synchronization that, upon first tests, seem to fix the hang issues sunshine had with the first iteration.

@Kishi85 Kishi85 changed the title fix(linux): run notify and acknowledge in async fix(linux): run notify and acknowledge async Jun 1, 2026
@Kishi85 Kishi85 force-pushed the run-notify-async-in-eventloop branch 5 times, most recently from cc1b3f7 to 0c71ed9 Compare June 1, 2026 12:27
@Kishi85

Kishi85 commented Jun 1, 2026

Copy link
Copy Markdown
Author

I've changed the fallback logic to only fire if libnotify cannot be initialized otherwise delayed libnotify notifications would cause the same notification showing twice (one for Qt, one for libnotify). I've also added a bit more polish so the whole notification part is easier to read and in a logical order.

I've tested this with the tray example/unit tests and also using Sunshine and could not find any crashing issues with this version of the implementation. Since my libnotify on KDE/CachyOS does not have the blocking DBus issues I've tested both codepaths (immediate/delayed) by adding a 25s sleep right before the problematic notify_notification_show/close for testing (as that would crash Sunshine due to hanging session when running sync).

All my tests so far have had positive results so I'm marking this ready for review and further testing by others.

UPDATE: I've put up comments asking people that want to test to do so in LizardByte/Sunshine#2778 and LizardByte/Sunshine#4199.

@Kishi85

Kishi85 commented Jun 5, 2026

Copy link
Copy Markdown
Author

Haven't had any feedback so far but from my personal testing I've also not seen any issues so this should be good to go.

@Kishi85 Kishi85 mentioned this pull request Jun 5, 2026
21 tasks
@Kishi85 Kishi85 force-pushed the run-notify-async-in-eventloop branch from 0c71ed9 to afc9ced Compare June 5, 2026 05:57
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

@ReenigneArcher ReenigneArcher merged commit 21a0a14 into LizardByte:master Jun 5, 2026
18 checks passed
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