Skip to content

Commit 761c459

Browse files
committed
wip
1 parent 169c053 commit 761c459

File tree

6 files changed

+17
-4
lines changed

6 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
- [Event Configuration] `propagateHeaders` allows forwarding headers from the original CDS context to the outbox call by specifying their names in an array.
1313

14-
1514
## v1.11.0 - 2025-10-16
1615

1716
### Added

docs/configure-event/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ they should be processed.
4141
## Parameters
4242

4343
| Property | Description | Default Value |
44-
|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|
44+
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
4545
| impl | Path of the implementation class associated with the event. | - |
4646
| type | Specifies the type of the event. | - |
4747
| subType | Specifies the subtype of the event, further categorizing the event type. | - |

src/outbox/eventQueueAsOutbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const _mapToEventAndPublish = async (context, subType, req, eventHeaders) => {
9797
for (const field of EVENT_QUEUE_SPECIFIC_FIELDS) {
9898
if (header.toLocaleLowerCase() === `x-eventqueue-${field.toLocaleLowerCase()}`) {
9999
eventQueueSpecificValues[field] = req.headers[header];
100-
delete req.headers[header];
100+
delete eventHeaders[header];
101101
break;
102102
}
103103
}

test/__snapshots__/eventQueueOutbox.test.js.snap

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true ad-hoc events overwrite se
4040
"load": 60,
4141
"parallelEventProcessing": 5,
4242
"priority": "medium",
43+
"propagateHeaders": [],
4344
"retryAttempts": 20,
4445
"selectMaxChunkSize": 10,
4546
"subType": "NotificationServicePeriodic.action",
@@ -64,6 +65,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true ad-hoc events overwrite se
6465
"load": 60,
6566
"parallelEventProcessing": 5,
6667
"priority": "medium",
68+
"propagateHeaders": [],
6769
"retryAttempts": 20,
6870
"selectMaxChunkSize": 10,
6971
"subType": "NotificationServicePeriodic.action",
@@ -88,6 +90,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true custom options should win
8890
"load": 1,
8991
"parallelEventProcessing": 5,
9092
"priority": "medium",
93+
"propagateHeaders": [],
9194
"retryAttempts": 20,
9295
"selectMaxChunkSize": 10,
9396
"subType": "NotificationServiceOutboxedByConfig",
@@ -124,6 +127,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true map config to event-queue
124127
"load": 1,
125128
"parallelEventProcessing": 5,
126129
"priority": "medium",
130+
"propagateHeaders": [],
127131
"retryAttempts": 20,
128132
"selectMaxChunkSize": 10,
129133
"subType": "NotificationService",
@@ -138,6 +142,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true option to use eventQueue.u
138142
"subject": "subject",
139143
"to": "to",
140144
},
145+
"headers": {},
141146
"subType": "NotificationServiceOutboxedByConfigUserId",
142147
"user": "dummyTestUser",
143148
}
@@ -158,6 +163,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true periodic events inherit co
158163
"keepAliveMaxInProgressTime": 210,
159164
"load": 60,
160165
"priority": "medium",
166+
"propagateHeaders": [],
161167
"subType": "NotificationServicePeriodic.main",
162168
"transactionMode": "isolated",
163169
"type": "CAP_OUTBOX_PERIODIC",
@@ -191,6 +197,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true periodic events inherit co
191197
"keepAliveMaxInProgressTime": 210,
192198
"load": 60,
193199
"priority": "medium",
200+
"propagateHeaders": [],
194201
"subType": "NotificationServicePeriodic.main",
195202
"transactionMode": "alwaysRollback",
196203
"type": "CAP_OUTBOX_PERIODIC",
@@ -215,6 +222,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true periodic events inherit co
215222
"keepAliveMaxInProgressTime": 210,
216223
"load": 60,
217224
"priority": "medium",
225+
"propagateHeaders": [],
218226
"subType": "NotificationServicePeriodic.main",
219227
"transactionMode": "isolated",
220228
"type": "CAP_OUTBOX_PERIODIC",
@@ -302,6 +310,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true req.data should be stored
302310
"subject": "subject",
303311
"to": "to",
304312
},
313+
"headers": {},
305314
"subType": "NotificationService",
306315
"user": "testUser",
307316
}
@@ -327,6 +336,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true req.data should be stored
327336
"subject": "subject",
328337
"to": "to",
329338
},
339+
"headers": {},
330340
"subType": "NotificationService",
331341
"user": "testUser",
332342
}
@@ -370,6 +380,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true should store correct user
370380
"subject": "subject",
371381
"to": "to",
372382
},
383+
"headers": {},
373384
"subType": "NotificationService",
374385
"user": "badman",
375386
}
@@ -391,6 +402,7 @@ exports[`event-queue outbox monkeyPatchCAPOutbox=true should work for outboxed s
391402
"load": 1,
392403
"parallelEventProcessing": 5,
393404
"priority": "medium",
405+
"propagateHeaders": [],
394406
"retryAttempts": 20,
395407
"selectMaxChunkSize": 10,
396408
"subType": "NotificationServiceOutboxedByConfig",

test/__snapshots__/initialize.test.js.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ exports[`initialize read yaml config file 1`] = `
1515
"load": 40,
1616
"parallelEventProcessing": 5,
1717
"priority": "medium",
18+
"propagateHeaders": [],
1819
"subType": "Task",
1920
"type": "Notifications",
2021
},
@@ -31,6 +32,7 @@ exports[`initialize read yaml config file 1`] = `
3132
"load": 10,
3233
"parallelEventProcessing": 1,
3334
"priority": "medium",
35+
"propagateHeaders": [],
3436
"subType": "CommunicationSystem",
3537
"type": "BusinessLogs",
3638
},

test/eventQueueOutbox.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ expect.extend({
18231823
};
18241824
},
18251825
actionCalled: (loggerMock, actionName, properties = {}) => {
1826-
const call = loggerMock.calls().info.find((c) => c[0]?.includes(actionName));
1826+
const call = loggerMock.calls().info.find((c) => actionName === c[0]);
18271827
if (!call) {
18281828
return {
18291829
message: () => `action not called! name: ${actionName}`,

0 commit comments

Comments
 (0)