From 83b3bca5f40d0a3dee6e39252bf1dae4e27f72dc Mon Sep 17 00:00:00 2001 From: JarbasAi Date: Sat, 30 Sep 2023 15:58:25 +0100 Subject: [PATCH] fallback/no_make_active let the intent service handle this, unittests in core uncovered duplicate messages this commit is fixing --- ovos_workshop/skills/fallback.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/ovos_workshop/skills/fallback.py b/ovos_workshop/skills/fallback.py index 963f65ae..5c598faa 100644 --- a/ovos_workshop/skills/fallback.py +++ b/ovos_workshop/skills/fallback.py @@ -212,14 +212,8 @@ def register_fallback(self, handler: Callable[[Message], None], # check if .conf is overriding the priority for this skill priority = priority_overrides.get(self.skill_id, priority) - def wrapper(*args, **kwargs): - if handler(*args, **kwargs): - self.activate() - return True - return False - self.instance_fallback_handlers.append(handler) - self._register_fallback(handler, wrapper, priority) + self._register_fallback(handler, handler, priority) @classmethod def _remove_registered_handler(cls, wrapper_to_del: callable) -> bool: @@ -403,15 +397,8 @@ def register_fallback(self, handler: callable, priority: int): LOG.info(f"registering fallback handler -> " f"ovos.skills.fallback.{self.skill_id}") - - def wrapper(*args, **kwargs): - if handler(*args, **kwargs): - self.activate() - return True - return False - - self._fallback_handlers.append((priority, wrapper)) - self.bus.on(f"ovos.skills.fallback.{self.skill_id}", wrapper) + self._fallback_handlers.append((priority, handler)) + self.bus.on(f"ovos.skills.fallback.{self.skill_id}", handler) def default_shutdown(self): """