Skip to content

Fix StoreCalendar overriding paused trigger state (#2053)#2968

Merged
lahma merged 2 commits into
3.xfrom
fix/store-calendar-preserves-trigger-state
Mar 31, 2026
Merged

Fix StoreCalendar overriding paused trigger state (#2053)#2968
lahma merged 2 commits into
3.xfrom
fix/store-calendar-preserves-trigger-state

Conversation

@lahma

@lahma lahma commented Mar 31, 2026

Copy link
Copy Markdown
Member

Summary

  • Fixes PuaseJob doesn't take effect #2053AddCalendar with updateTriggers=true was unconditionally setting trigger state to WAITING, overriding any paused/blocked state
  • Now reads the actual trigger state from the database and preserves it via forceState: true
  • Skips triggers in DELETED state

Test plan

  • Unit tests pass (1036 passed, 0 failed)
  • Verify with ADO.NET job store that pausing a job, then updating its calendar, keeps the trigger paused

🤖 Generated with Claude Code

When AddCalendar was called with updateTriggers=true, StoreTrigger was
always called with StateWaiting, which would override any existing
trigger state (PAUSED, BLOCKED, etc.). This caused manually paused
jobs to automatically resume when their associated calendar was updated.

Now reads the actual trigger state from the database and preserves it.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@lahma lahma added the port-main Requires porting to main branch label Mar 31, 2026
Tests verify that StoreCalendar with updateTriggers=true preserves
the existing trigger state (PAUSED, BLOCKED, PAUSED_BLOCKED, WAITING,
COMPLETE, ERROR) instead of overriding to WAITING. Also verifies that
DELETED triggers are skipped and that mixed states on multiple triggers
are preserved independently.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@lahma
lahma merged commit 39c7ab0 into 3.x Mar 31, 2026
15 checks passed
@lahma
lahma deleted the fix/store-calendar-preserves-trigger-state branch March 31, 2026 18:59
lahma added a commit that referenced this pull request Mar 31, 2026
When AddCalendar was called with updateTriggers=true, StoreTrigger was
always called with StateWaiting, which would override any existing
trigger state (PAUSED, BLOCKED, etc.). This caused manually paused
jobs to automatically resume when their associated calendar was updated.

Now reads the actual trigger state from the database and preserves it.

Port of #2968 from 3.x branch.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@lahma lahma removed the port-main Requires porting to main branch label Mar 31, 2026
lahma added a commit that referenced this pull request Mar 31, 2026
When AddCalendar was called with updateTriggers=true, StoreTrigger was
always called with StateWaiting, which would override any existing
trigger state (PAUSED, BLOCKED, etc.). This caused manually paused
jobs to automatically resume when their associated calendar was updated.

Now reads the actual trigger state from the database and preserves it.

Port of #2968 from 3.x branch.

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
This was referenced Apr 3, 2026
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.

1 participant