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

extension Unload event should be sent to extension when user disabled them #1386

Open
5 tasks done
friday opened this issue May 1, 2024 · 0 comments
Open
5 tasks done
Labels
Milestone

Comments

@friday
Copy link
Member

friday commented May 1, 2024

Environment

Any

Bug description

The extension Unload event is sent to extensions when Ulauncher is closed, but not when you manually close them.

It is located in Client.py which is called when the socket closes. It should be triggered in the stop method instead.

self.extension.trigger_event({"type": "event:unload"})

async def stop(self) -> None:
"""
Terminates extension
"""
logger.info('Terminating extension "%s"', self.ext_id)
self.subprocess.send_signal(signal.SIGTERM)
await asyncio.sleep(0.5)
if self.subprocess.get_identifier():
logger.info("Extension %s still running, sending SIGKILL", self.ext_id)
# It is possible that the process exited between the check above and this signal,
# luckily the subprocess library handles the signal delivery in race-free way, so this
# is safe to do.
self.subprocess.send_signal(signal.SIGKILL)

Log output

No response

Communication guidelines

  • I have read and agree with Ulauncher's communication guidelines and checked the troubleshooting page for self-help.
  • I have tried to understand the error message and help myself, before reporting it.
  • My issue description has clear steps for how to reproduce the issue.
  • This issue applies to the whole Ulauncher application, not for a specific extension.

Ulauncher v6

  • I have made sure the bug isn't already fixed in v6.
@friday friday added the bug label May 1, 2024
@friday friday added this to the v6.0.0 milestone May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant