Repository navigation
Keep restored active app triggers enabled on the broker - #467
Merged
SiddDevZ merged 1 commit intoDec 3, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
AppTriggerManager.restore()calledapplyEnabled(trigger.remote.triggerId)before inserting the restored trigger back intothis.triggers. BecausewantsEnabled()checksthis.triggers, restoring an enabled automation that no other active trigger shared causedapplyEnabled()to evaluatewantsEnabled()asfalseand 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.deletedremoval andthis.triggers.unshift(trigger)ahead ofbind()andapplyEnabled()insideexclusive()(matchingupdate()), 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 lintandpnpm testpass (typecheck, lint, and all 5 targeted unit/integration/e2e suites above passed; full repo-widepnpm testwas not run locally)New behaviour has a test
No secrets, personal data or local paths in the diff or screenshots