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

Add proper handler for gui release events #57

Merged
merged 1 commit into from
Feb 18, 2021

Conversation

AIIX
Copy link
Collaborator

@AIIX AIIX commented Feb 17, 2021

Description

Adds a proper handler for self.gui.release() emitted events

This handler is responsible for removing the skill from the namespace using "gui.clear.namespace" and cancelling all idle screen events associated with it.

Type of PR

If your PR fits more than one category, there is a high chance you should submit more than one PR. Please consider this carefully before opening the PR.
Either delete those that do not apply, or add an x between the square brackets like so: - [x]

  • Bugfix
  • Feature implementation
  • Refactor of code (without functional changes)
  • Documentation improvements
  • Test improvements

Testing

Test against: MycroftAI/mycroft-core#2683
and any skill that incorporates "self.gui.release()" method

CLA

  • yes

if get_skill_namespace:
self.bus.emit(Message("gui.clear.namespace",
{"__from": get_skill_namespace}))
self.resting_screen.cancel_override()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cancel any override screen regardless of whether it matches the skill_id of the namespace we're clearing?

Eg could the following scenario occur?

  • Skill A is triggered, performing some action
  • Skill B is triggered and overrides idle
  • Skill A finishes and clears it's namespace
  • Skill B's idle override gets unintentionally cancelled

Copy link
Collaborator Author

@AIIX AIIX Feb 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idle / resting screen implementation to me atleast doesn't seem to account for namespaces or maintain any list of skills that have an override, It seems to only apply the override logic on the current page being displayed so even if Skill A is triggered and is performing some action, Skill B by just being triggered after that will probably cause it to override the previous Skill A idle override, the cancel_override() will then only cancel Skill B override because that is what the resting screen currently knows

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, definitely outside the scope of this PR, but I wonder if we need to look at that.

I'll create a new issue for that and merge this in.

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants