Jas-SinghFSU / HyprPanel

A Bar/Panel for Hyprland with extensive customizability.
MIT License
620 stars 47 forks source link

[BUG] Clear all notifs make Hyprpanel crash #326

Closed Ciflire closed 2 days ago

Ciflire commented 4 days ago

Describe the bug The button makes the bar crash

To Reproduce I have 5000 notifications, but i think clearing more that 15 notifs should be enough to see that bug, i get it after 10

Expected behavior I expect it not to crash but i think this is somehow an ags bug, clearing manually and faster that 1 notification per second makes the bar crash. This can be avoided with the right setup for the "clear notifications" button There's a clearDelay parameter for notifications, i tried with 100/250/500/750/1000, only 1000 worked in that list The clearDelay parameter is used by the Clear method for notifications, i guess this one should be used instead

// modules/menus/notifications/controls/index.ts l52
                                on_primary_click: () => {
                                    if (removingNotifications.value) {
                                        return;
                                    }
                                    notifs.clearDelay = 1000;
                                    notifs.Clear();
                                },

Desktop (please complete the following information):

Additional context I can submit a PR if what i've done suits you

Jas-SinghFSU commented 2 days ago

100ms is the standard default for AGS which seems to work for most people. I'm extremely curious as to why you have to wait 1 whole second between notification removal.

This may be something that improves in AGS v2 so we can revisit this if it still persists.

Ciflire commented 2 days ago

Fixed now with less notifs waiting on dismiss, probably because of the 5000 i had Smth you can't do anything against i believe, maybe a different delay depending on the numbers of notifs but that's not worth it