---
id: change/bcapps/11257
type: change
title: "#11257 Fix duplicate retention continuations for Waiting jobs"
summary: Retention policy continuation scheduling now detects Waiting jobs to prevent duplicate continuations when the dispatcher moves a job to Waiting status, checking for existing Waiting work before creating or restarting continuations.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit retention policy jq
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:04:09.054Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: f86cb04d7d81db561a904204487d9e32c354fc15
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/11257
    title: "microsoft/BCApps#11257: Fix duplicate retention continuations for Waiting jobs"
    date: "2026-09-23"
    commit: f86cb04d7d81db561a904204487d9e32c354fc15
    t: null
    quote: Once the dispatcher moved an existing continuation to Waiting, another limit-exceeded notification could create a duplicate.
links:
  learn: []
  objects:
    - object/codeunit/3997
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 11257
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/11257
kind: pr
base_branch: main
major: "30"
merged_at: "2026-09-23T09:37:03Z"
author: darjoo
author_type: User
community_contribution: false
labels:
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 240
  deletions: 9
  al: 1
apps:
  - Base Application
objects_touched:
  - key: codeunit/3997
    page: codeunit/3997
    type: codeunit
    id: 3997
    name: Retention Policy JQ
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 649571
systems:
  - development
quote: Once the dispatcher moved an existing continuation to Waiting, another limit-exceeded notification could create a duplicate.
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #11257 Fix duplicate retention continuations for Waiting jobs

> Retention policy continuation scheduling now detects Waiting jobs to prevent duplicate continuations when the dispatcher moves a job to Waiting status, checking for existing Waiting work before creating or restarting continuations.

[Pull request](https://github.com/microsoft/BCApps/pull/11257) · merged into `main` (BC30) on 2026-09-23 by darjoo · 2 files (+240 -9), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Check for Waiting continuations before selecting Ready or On Hold jobs to prevent duplicates
- Use IsEmpty() for efficient Waiting job detection without materializing records
- Waiting work takes priority in scheduling decisions
- Internal scheduling helper returns whether a create or restart actually occurred
- Six new test cases cover duplicate prevention and priority scenarios
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 3997 "Retention Policy JQ"](../../objects/codeunit/3997.md), Base Application: modified

## Context

- Work items: AB#649571
- Labels: Team: Integrations
- Systems: development
- From the description: "Once the dispatcher moved an existing continuation to Waiting, another limit-exceeded notification could create a duplicate."

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
