Skip to content

feat: notify the user if an extension has raised an exception #832

Description

@mattalxndr

Steps to reproduce

  1. Install an extension that throws an error right as you submit it. The extension should be one that doesn't require immediate action or feedback. One example is creating a Todo tasks using the cmuench/ulauncher-todoist extension. You submit the task and that's the end of it.
  2. Do the action.

Current behavior

  1. No feedback at the time.
  2. Forget the submitted task altogether.
  3. Repeat several times a day for about a week.
  4. Figure this all out and start tearing through /var/log in vain!

Side Note: All joking aside, @cmuench, I should have verified that it was working. I really like the extension and I plan to submit a PR in the next few days :-)

Expected behavior

An error notification of some kind, so the user knows that the action they just took may not have produce the desired result.

Environment

Ulauncher version: 5.14.0

2021-10-22 02:02:43,401 | INFO | ulauncher: main() | Ulauncher version 5.14.0
2021-10-22 02:02:43,402 | INFO | ulauncher: main() | Extension API version 2.0.0
2021-10-22 02:02:43,402 | INFO | ulauncher: main() | GTK+ 3.24.30
2021-10-22 02:02:43,402 | INFO | ulauncher: main() | Is Wayland: False
2021-10-22 02:02:43,402 | INFO | ulauncher: main() | Wayland compatibility: off

Linux distro: Arch Linux, updated at least weekly.
Desktop environment: KDE Plasma 5.23.1-1

Logs

https://gist.github.com/mattalexx/cb19f616d70bc5e5a5db32bc78a95079

Activity

  1. cmuench commented on Oct 22, 2021

    @cmuench

    @mattalexx :-) Feel free to create a PR.

  2. friday commented on Oct 27, 2021

    @friday
    Member

    I don't think Ulauncher can really handle extension errors other than logging the output. They run as separate processes and Ulauncher doesn't control their runtime. Some extensions will also trigger lots of error but still function, because of being implemented in a rush or by hobby developers, so even if we could it may not be something we should do.

  3. mattalxndr commented on Nov 3, 2021

    @mattalxndr
    Author

    I'm not sure if this is too "developer"-y a feature, but perhaps having a global or per extension "Be notified of errors on submission" flag would be good.

    The extension list contains a lot of abandonded projects, and it's hard to tell which is which without doing your own investigation.

    Just a suggestion.. I would work on a PR if you agreed, since I'm already planning on running a patched build with this feature, sans UI.

  4. friday commented on Nov 3, 2021

    @friday
    Member

    I'm open to the idea. We need other debugging improvements as well (#818), and could perhaps combine them.

  5. friday commented on Apr 1, 2024

    @friday
    Member

    I realize I had the need for this myself for an extension. I'm importing gir1.2-notify to send notifications manually if there is a dependency runtime exception for https://github.com/friday/ulauncher-clipboard

    But since Ulauncher 6 removed the gir1.2-notify dependency in favor of Gio.Application.send_notification, it would be nice to expose a way for extensions to send these, and the suggestion here would also work with raising an exceptions manually, but it needs to apply more widely for raised exceptions (not just on item enter).
    Maybe that'll be annoying/verbose, but we can tune it later, or add ways to opt out completely or per extension.

    Will add this to the v6 milestone and hopefully get it included soon. Not sure yet how we want to handle it

  6. added this to the v6.0.0 milestone on Apr 1, 2024
  7. changed the title [-]Ulauncher should alert the user if an extension has thrown an error during `ItemEnterEventListener` [/-] [+]feat: notify the user if an extension has raised an exception[/+] on Apr 1, 2024
  8. modified the milestones: v6.0.0, post-v6 on Apr 18, 2025
  9. friday commented on Apr 18, 2025

    @friday
    Member

    I started working on this more than one time, but the extension <-> Ulauncher communication makes it hard.

    We can catch the exception in the Extension class listeners. Then it needs to be sent to Ulauncher with the socket JSONFramer. This is quite a messy internal logic that is hard to work with. If someone wants to help it's very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions