dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

[BUG] Different numbers of packages to update across multiple monitors

Open ArekKubinski opened this issue 10 months ago • 9 comments

Describe the bug

Image

The number of packages to update near the icon is not consistent, sometimes it shows differences up to 100. Example 123 on the right and 16 on the left (i should took ss before i updated but i hoped the bug will be gone i actually saw it appear since the begging of my setup)

Steps to reproduce

I use this monitor config

monitor= desc:HP Inc. HP 27xq CNK046117C, [email protected], 0x0, 1
monitor= desc:Acer Technologies Acer BW257 0x0127B1A6, [email protected], 2560x0, 1
monitor= desc:LG Electronics LG TV 0x01010101, [email protected], auto, 1, mirror, desc:HP Inc. HP 27xq CNK046117C
monitor = , preferred, auto, 1

This setup is a dual monitor with mirrored screen on the left to the TV and 4th option is for any additional screen to configure it with default options.

Expected behavior

I expected the numbers to be the same across all monitors

Screenshots

No response

Distribution

Arch Linux

If Other, specify

Linux 6.12.10-arch1-1

Additional context

This is freshly updated and reported as fast as I noticed update alert show up.

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

ArekKubinski avatar Feb 01 '25 21:02 ArekKubinski

@ArekKubinski I thinks the reason is that both status bars send independently the request to the update script. Can you wait min 30 minutes and check then again if both are showing then the right number?

Or try to reload your waybars with SUPER + SHIFT + B

mylinuxforwork avatar Feb 02 '25 10:02 mylinuxforwork

So this is a state right after reboot, i believe that the state on the left monitor is real state and on the right there is no updates according to icon (rather the lack of any icon).

Image

After that I reloaded waybars (they both disappear and appear visually at the same time) and the number moved from left monitor to the right.

Image

I had mouse on the right monitor while reloading first time but moving mouse to the left monitor and reloading once again changed noting (repeated that few times, every time result was identical like on the second ss).

ArekKubinski avatar Feb 02 '25 20:02 ArekKubinski

Crazy. Actually no clue how to fix this.

mylinuxforwork avatar Feb 03 '25 16:02 mylinuxforwork

Any idea how I can debug it? For some time it kinda was fine since on one waybar it was 0 and as such didn't showed up at all. But today its again 1 and 47 and it kinda driving me mad 😃

Image

ArekKubinski avatar Feb 04 '25 14:02 ArekKubinski

I might have an idea on how to solve this. This afternoon I'll get to work on a PR.

The problem may be due to the fact that the script is called several times when the waybar is called on several monitors (2 extra in my case), but does not deliver consistent results due to the locked Pacman database.

So my idea is to delay the check in the script until the database is free again.

It can still happen that a new package is added to the update during the delay, but the differences should be minimal and rare.

degobbis avatar Feb 07 '25 09:02 degobbis

This Changes solves the issue (https://github.com/mylinuxforwork/dotfiles/pull/707)

degobbis avatar Feb 07 '25 14:02 degobbis

@ArekKubinski Just merged into the main branch. Can you please test? Install ml4w-hyprland-git, rebuild all packages and run ml4w-hyprland-setup

mylinuxforwork avatar Feb 07 '25 15:02 mylinuxforwork

Truth be told I rather not move to unstable branch just to test this but replaced updates.sh and after refreshing waybar this seems to work as intended. I can see delay now but I guess it is better than being just plain wrong. Seems closed to me and I'm waiting for it to be released. Thanks very much to all involved.

ArekKubinski avatar Feb 10 '25 20:02 ArekKubinski

Truth be told I rather not move to unstable branch just to test this but replaced updates.sh and after refreshing waybar this seems to work as intended. I can see delay now but I guess it is better than being just plain wrong. Seems closed to me and I'm waiting for it to be released. Thanks very much to all involved.

Okay this seems to occur only after restart but the count is different on both monitors, idk if it is because I didn't moved to -git branch and there are more scripts to be replaced but fresh start have this bug, reloading waybar gets rid of it.

ArekKubinski avatar Feb 11 '25 15:02 ArekKubinski