# Bug OP-19861 - Non-working days saved while reschedule job is running are not applied to work packages

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-19861

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module | Modules and project features / Relations and scheduling |
| Target versions | 17.7.2 |
| Observed in versions |  |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Oliver Günther |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Before filing a report

_Before you file a report, please ensure you are running the latest version of OpenProject and_&nbsp;  
_have searched for similar bug reports._

### Steps to reproduce

1.  Log in as an administrator
    
2.  Go to **Administration → Calendars and dates → Working days**
    
3.  Add several non-working days (e.g. 28–31 Dec) and save so that `WorkPackages::ApplyWorkingDaysChangeJob` starts rescheduling work packages
    
4.  **While that job is still running**, add further non-working days (e.g. 4–5 Jan) and save again
    
    1.  This may not be easy to reproduce and needs enough data, or halting/slowing the execution manually
        

### What is the buggy behavior?

*   The second save succeeds even though an apply job is still running
    
*   The new non-working days are persisted, but no follow-up `ApplyWorkingDaysChangeJob` runs for them (GoodJob aborts enqueue due to `total_limit: 1`)
    
*   Work packages covering those dates are not rescheduled
    
*   Journals from the first job only list the dates from the first save (the job diffs against a live `NonWorkingDay.pluck` / memoized cause and never picks up dates added mid-run)
    

### What is the expected behavior?

1.  While an `ApplyWorkingDaysChangeJob` (or the phases equivalent) is still queued or running, further working-days / non-working-days changes are blocked with the existing “previous changes have not been applied yet” error
    
2.  Only after that job finishes can another change be saved — and that save must enqueue a job that reschedules affected work packages for the newly added/removed dates and records those dates in the journal cause
