Skip to content

Keep restored active app triggers enabled on the broker - #467

Merged
SiddDevZ merged 1 commit into
DuskBotAI:devfrom
samyyy2311:fix-app-trigger-restore-enabled
Dec 3, 2026
Merged

SiddDevZ merged 1 commit into
DuskBotAI:devfrom
samyyy2311:fix-app-trigger-restore-enabled

Conversation

@samyyy2311

Copy link
Copy Markdown
Contributor

What and why

AppTriggerManager.restore() called applyEnabled(trigger.remote.triggerId) before inserting the restored trigger back into this.triggers. Because wantsEnabled() checks this.triggers, restoring an enabled automation that no other active trigger shared caused applyEnabled() to evaluate wantsEnabled() as false and immediately disable the newly bound trigger on the broker, silently dropping incoming events until the next reconciliation while local state showed it as active.

This moves this.deleted removal and this.triggers.unshift(trigger) ahead of bind() and applyEnabled() inside exclusive() (matching update()), so active restores stay enabled on the broker and paused restores are still disabled.

How it was checked

  • corepack pnpm vitest run server/app-triggers.test.ts server/app-trigger-host-routine.test.ts server/bot-automations.test.ts (3 files passed, 25 tests passed)

  • corepack pnpm vitest run server/app-events.e2e.test.ts server/app-events-cloud.e2e.test.ts (2 files passed, 2 tests passed)

  • corepack pnpm typecheck (exited 0)

  • corepack pnpm lint (oxlint --deny-warnings ., 0 warnings, 0 errors across 8092 files)

  • pnpm typecheck, pnpm lint and pnpm test pass (typecheck, lint, and all 5 targeted unit/integration/e2e suites above passed; full repo-wide pnpm test was not run locally)

  • New behaviour has a test

  • No secrets, personal data or local paths in the diff or screenshots

@SiddDevZ
SiddDevZ merged commit 9265293 into DuskBotAI:dev Dec 3, 2026
17 of 21 checks passed
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