@sap/cds 9.6.2 → 9.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@
4
4
  - The format is based on [Keep a Changelog](https://keepachangelog.com/).
5
5
  - This project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## Version 9.6.3 - 2026-01-14
8
+
9
+ ### Fixed
10
+
11
+ - `queue`: Exactly-once guarantee only with `legacyLocking: false`
12
+
7
13
  ## Version 9.6.2 - 2026-01-08
8
14
 
9
15
  ### Fixed
@@ -244,7 +244,8 @@ const _processTasks = (target, tenant, _opts = {}) => {
244
244
  const _run = opts.legacyLocking && cds.db?.kind === 'sqlite' ? cds._with : service.tx.bind(service)
245
245
  const result = await _run({ ...task.context, tenant }, async () => {
246
246
  const result = opts.handle ? await opts.handle.call(service, task.msg) : await service.handle(task.msg)
247
- await DELETE.from(tasksEntity).where({ ID: task.ID })
247
+ // we can only delete in the current tx if legacyLocking (i.e., long-lasting db locks) is false
248
+ if (!opts.legacyLocking) await DELETE.from(tasksEntity).where({ ID: task.ID })
248
249
  return result
249
250
  })
250
251
  task.results = result
@@ -295,13 +296,15 @@ const _processTasks = (target, tenant, _opts = {}) => {
295
296
  }
296
297
 
297
298
  const queries = []
298
- if (toBeDeleted.length)
299
+ const _toBeDeleted = opts.legacyLocking ? toBeDeleted.concat(succeeded) : toBeDeleted
300
+ if (_toBeDeleted.length) {
299
301
  queries.push(
300
302
  DELETE.from(tasksEntity).where(
301
303
  'ID in',
302
- toBeDeleted.map(msg => msg.ID)
304
+ _toBeDeleted.map(msg => msg.ID)
303
305
  )
304
306
  )
307
+ }
305
308
 
306
309
  // There can be tasks which are not updated / deleted, their status must be set back to `null`
307
310
  const updateTasks = selectedTasks.filter(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds",
3
- "version": "9.6.2",
3
+ "version": "9.6.3",
4
4
  "description": "SAP Cloud Application Programming Model - CDS for Node.js",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [