Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Uncaught Exception: Tray is destroyed #1545

Closed
mss opened this issue Jan 16, 2025 · 9 comments · Fixed by #1555 or #1556
Closed

[Bug]: Uncaught Exception: Tray is destroyed #1545

mss opened this issue Jan 16, 2025 · 9 comments · Fixed by #1555 or #1556
Assignees
Labels
bug Something isn't working

Comments

@mss
Copy link

mss commented Jan 16, 2025

Can you reproduce this bug in the PWA?

Not applicable

Describe the bug

An exception dialog with an uncaught exception in ApplicationTray.updateTrayImage popped up

What package are you using?

flatpak

Version

1.11.5

Reproduction steps

I can't really reproduce this issue, the dialog below just popped up when I woke my machine from sleep. Feel free to close this issue but maybe a small exception handler would avoid this issue already.

My version is/was rather old but I checked the changes between v1.11.5 and v1.12.5 and couldn't find anything touching that code (I didn't check the flatpak repo though).

Expected Behavior

No uncaught exception dialog.

Debug

No response

Additional context

image

@mss mss added the bug Something isn't working label Jan 16, 2025
@IsmaelMartinez
Copy link
Owner

Hi @mss , thanks for reporting. I can't think of a change that might have trigger this. Are you able to find any logs? Can you see if you can reproduce this by maybe bringing your laptop to sleep?

@mss
Copy link
Author

mss commented Jan 16, 2025

@IsmaelMartinez I don't think this is a new issue. I use Teams daily and that version for a while now (since November apparently) and it never happened before. I guess it is just some race condition with suspending and my DE (I use KDE) which triggered it in this case.

In my journal I see a lot of xdg-desktop-por[1502]: Icon validation: Child process exited with code 1 but those aren't new either and maybe related to #1491.

Maybe it is possible to catch this condition and handle it more graceful. If not, feel free to close this; if I ever run into it again I'll try to get more information.

@mss
Copy link
Author

mss commented Jan 20, 2025

It just happened again, this time with v1.12.5. I don't know yet how to reproduce it but I can add some other details:

I normally close Teams at the end of the working day and then put my laptop to sleep to continue where I was the next day. Because if I don't close Teams when I disconnect my Bluetooth headset, Teams (or PipeWire who knows) often confuses the input streams afterwards and I have issues in the first call of the day. So I either shut down Teams in the evening or if I forgot to do so I exit Teams with Ctrl+Q shortly after I reactivated my laptop.

And this is when the exception happened today and probably also the last time: When I hit Ctrl+Q. But not always, it somehow is connected with either a longer suspend time or my Bluetooth headset reconnecting or something.

Exception still occurs here https://github.com/IsmaelMartinez/teams-for-linux/blob/v1.12.5/app/menus/tray.js#L33.

@mss
Copy link
Author

mss commented Jan 20, 2025

I digged a bit through the history and that line is more or less unchanged since it was introduced on v1.7.5 to fix #602. A comment mentions something about "The tray is not getting closed." so it probably makes sense that this exception happens when I close the app. It doesn't make sense that it started happening only recently unless KDE changed something in their implementation. I am on latest KDE:

Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.8.0-51-generic (64-bit)
Graphics Platform: Wayland

@mss
Copy link
Author

mss commented Jan 20, 2025

Actually, it looks like the change of the event happened even before that, in 8442e43. I couldn't find any documentation on that tray-update event to check if there is some metadata attached which could fix this issue by not updating the tray when it was already deleted.

@mss
Copy link
Author

mss commented Jan 20, 2025

Ah, no wonder I couldn't find any documentation. That even is actually sent internally here https://github.com/IsmaelMartinez/teams-for-linux/blob/v1.12.5/app/browser/tools/trayIconRenderer.js#L17.

But there is a Tray.isDestroyed() method available which should probably be checked before the tray is updated: https://www.electronjs.org/docs/latest/api/tray#trayisdestroyed

@IsmaelMartinez
Copy link
Owner

Thanks for the info. I will see when I can have a further look at this and to add some extra checks.

@IsmaelMartinez
Copy link
Owner

IsmaelMartinez commented Jan 21, 2025

This should be fixed in #1555, that should be released as 1.12.7. Thanks for reporting!

@mss
Copy link
Author

mss commented Jan 22, 2025

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants