@reventlessdev/reventless-core 3.0.0-alpha.341 → 3.0.0-alpha.342
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 +16 -0
- package/package.json +7 -7
- package/src/Projection.res +32 -4
- package/src/Projection.res.mjs +51 -4
- package/src/ViewChange.res +1 -9
- package/src/ViewChange.res.mjs +2 -13
- package/src/admin/Platform_ComponentDefinitionsApi.res +29 -1
- package/src/admin/Platform_ComponentDefinitionsApi.res.mjs +47 -1
- package/src/admin/Platform_PluginStructuresApi.res +4 -3
- package/src/admin/Platform_PluginStructuresApi.res.mjs +5 -1
- package/src/components/Api/SuryToJsonSchema.res +7 -0
- package/src/components/Api/SuryToJsonSchema.res.mjs +18 -0
- package/src/components/Dcb/Dcb_Builder.res +59 -0
- package/src/components/Dcb/Dcb_Builder.res.mjs +48 -3
- package/src/components/DcbEventLog/DcbEventLog.res +2 -0
- package/src/components/DcbEventLog/DcbEventLog_Adapter.res +7 -0
- package/src/components/DcbEventLog/DcbEventLog_Builder.res +12 -3
- package/src/components/DcbEventLog/DcbEventLog_Builder.res.mjs +5 -3
- package/src/components/DcbEventLog/DcbEventLog_Operations.res +3 -0
- package/src/components/DcbEventLog/DcbEventLog_Operations.res.mjs +3 -1
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res.mjs +2 -2
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res +158 -107
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +178 -154
- package/src/components/StateChangeSlice/StateChangeSlice.res +3 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res +6 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res.mjs +5 -4
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +369 -279
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +210 -166
- package/src/plugin/component/Plugin_Structure.res +45 -0
- package/src/plugin/component/Plugin_Structure.res.mjs +42 -1
- package/src/util/Logger.res +5 -5
- package/src/util/Logger.res.mjs +3 -3
- package/tests/admin/AdminApiSchemaDriftTest.res +23 -0
- package/tests/admin/AdminApiSchemaDriftTest.res.mjs +21 -1
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res +1 -0
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +1 -0
- package/tests/admin/Platform_PluginStructuresApiTest.res +1 -0
- package/tests/admin/Platform_PluginStructuresApiTest.res.mjs +1 -0
- package/tests/api/QuantitySemanticTest.res +68 -0
- package/tests/api/QuantitySemanticTest.res.mjs +68 -0
- package/tests/commandgenerator/OwnerActingTest.res.mjs +1 -1
- package/tests/commandtopic/CommandOutcomeHookTest.res.mjs +1 -1
- package/tests/dcb/DcbFenceCountReadTest.res +213 -0
- package/tests/dcb/DcbFenceCountReadTest.res.mjs +358 -0
- package/tests/dcb/DcbPiiSliceTest.res.mjs +1 -1
- package/tests/dcb/DcbReadsNothingTest.res.mjs +1 -1
- package/tests/dcb/DcbScopeInferenceTest.res +143 -2
- package/tests/dcb/DcbScopeInferenceTest.res.mjs +192 -2
- package/tests/dcb/DcbStateChangeSliceTest.res.mjs +22 -22
- package/tests/dcb/DcbTagTest.res +68 -0
- package/tests/dcb/DcbTagTest.res.mjs +86 -10
- package/tests/dcb/DcbValidationTest.res.mjs +1 -1
- package/tests/logger/LoggerLazyTest.res.mjs +3 -3
- package/tests/plugin/PluginStructureAccessTest.res +1 -0
- package/tests/plugin/PluginStructureAccessTest.res.mjs +1 -1
- package/tests/plugin/PluginStructureTest.res +61 -0
- package/tests/plugin/PluginStructureTest.res.mjs +78 -32
- package/tests/plugin/StateChange/PsRateSession.res +37 -0
- package/tests/plugin/StateChange/PsRateSession.res.mjs +80 -0
- package/tests/plugin/pluginDefinitionRequiredScalars.txt +10 -0
- package/tests/projection/ViewChangeTest.res +32 -0
- package/tests/projection/ViewChangeTest.res.mjs +57 -0
|
@@ -22,6 +22,15 @@ function arr(name) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
function cross(name) {
|
|
26
|
+
return {
|
|
27
|
+
name: name,
|
|
28
|
+
isList: false,
|
|
29
|
+
declared: true,
|
|
30
|
+
crossPartition: true
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
25
34
|
function ev(eventType, idFields) {
|
|
26
35
|
return {
|
|
27
36
|
eventType: eventType,
|
|
@@ -964,6 +973,59 @@ globalThis.describe("DcbScopeInference:", () => {
|
|
|
964
973
|
]);
|
|
965
974
|
globalThis.expect(issues.overrides.map(e => e.sliceName)).toEqual([]);
|
|
966
975
|
globalThis.expect(issues.contradictions.map(e => e.sliceName)).toEqual(["ShipOrder"]);
|
|
976
|
+
globalThis.expect(issues.contradictions.every(e => e.message.includes("mark orderId @crossPartition on WarehouseAssigned"))).toBe(true);
|
|
977
|
+
globalThis.expect(DcbScopeInference$Reventless.infer([
|
|
978
|
+
placeOrder,
|
|
979
|
+
newrecord,
|
|
980
|
+
assign
|
|
981
|
+
]).crossPartitionPairs).toEqual([]);
|
|
982
|
+
});
|
|
983
|
+
globalThis.test("marked @crossPartition, the same read is an override with one pair", () => {
|
|
984
|
+
let assign = slice("AssignWarehouse", undefined, undefined, [{
|
|
985
|
+
eventType: "WarehouseAssigned",
|
|
986
|
+
idFields: [
|
|
987
|
+
{
|
|
988
|
+
name: "warehouseId",
|
|
989
|
+
isList: false
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
name: "orderId",
|
|
993
|
+
isList: false
|
|
994
|
+
}
|
|
995
|
+
]
|
|
996
|
+
}], "warehouseId", "Warehouse");
|
|
997
|
+
let newrecord = {...shipOrder};
|
|
998
|
+
newrecord.consumed = shipOrder.consumed.concat([{
|
|
999
|
+
eventType: "WarehouseAssigned",
|
|
1000
|
+
idFields: [
|
|
1001
|
+
{
|
|
1002
|
+
name: "warehouseId",
|
|
1003
|
+
isList: false
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
name: "orderId",
|
|
1007
|
+
isList: false,
|
|
1008
|
+
declared: true,
|
|
1009
|
+
crossPartition: true
|
|
1010
|
+
}
|
|
1011
|
+
]
|
|
1012
|
+
}]);
|
|
1013
|
+
let boundary = [
|
|
1014
|
+
placeOrder,
|
|
1015
|
+
newrecord,
|
|
1016
|
+
assign
|
|
1017
|
+
];
|
|
1018
|
+
let issues = DcbValidation$Reventless.validatePartitionHintsVsInference(boundary);
|
|
1019
|
+
globalThis.expect(issues.contradictions).toEqual([]);
|
|
1020
|
+
globalThis.expect(issues.overrides.map(e => e.sliceName)).toEqual(["ShipOrder"]);
|
|
1021
|
+
let d = DcbScopeInference$Reventless.infer(boundary);
|
|
1022
|
+
globalThis.expect(d.crossPartitionPairs).toEqual([{
|
|
1023
|
+
reader: "ShipOrder",
|
|
1024
|
+
eventType: "WarehouseAssigned",
|
|
1025
|
+
key: "orderId",
|
|
1026
|
+
writers: ["AssignWarehouse"]
|
|
1027
|
+
}]);
|
|
1028
|
+
globalThis.expect(d.crossPartitionTagKeys).toEqual([]);
|
|
967
1029
|
});
|
|
968
1030
|
let postMessage = slice("PostMessage", undefined, undefined, [{
|
|
969
1031
|
eventType: "MessagePosted",
|
|
@@ -1117,10 +1179,137 @@ globalThis.describe("DcbScopeInference:", () => {
|
|
|
1117
1179
|
globalThis.expect(r.candidatesBySlice["QuestionState"]).toEqual([]);
|
|
1118
1180
|
});
|
|
1119
1181
|
globalThis.test("a hint deciding a slice inference leaves unresolved is accepted", () => {
|
|
1120
|
-
let
|
|
1182
|
+
let boundary = [
|
|
1183
|
+
postMessage,
|
|
1184
|
+
questionState
|
|
1185
|
+
];
|
|
1186
|
+
let issues = DcbValidation$Reventless.validatePartitionHintsVsInference(boundary);
|
|
1121
1187
|
globalThis.expect(issues.contradictions).toEqual([]);
|
|
1122
1188
|
globalThis.expect(issues.redundancies).toEqual([]);
|
|
1123
|
-
globalThis.expect(DcbScopeInference$Reventless.resolvePartitions(
|
|
1189
|
+
globalThis.expect(DcbScopeInference$Reventless.resolvePartitions(boundary).partitionBySlice["QuestionState"]).toEqual("messageId");
|
|
1190
|
+
});
|
|
1191
|
+
globalThis.test("a hint deciding an unresolved slice is refused when its read misses events stored elsewhere", () => {
|
|
1192
|
+
let issues = DcbValidation$Reventless.validatePartitionHintsVsInference(questions);
|
|
1193
|
+
globalThis.expect(issues.contradictions.map(e => e.sliceName)).toEqual(["QuestionState"]);
|
|
1194
|
+
globalThis.expect(issues.contradictions.every(e => e.message.includes("mark messageId @crossPartition on ReplyPosted"))).toBe(true);
|
|
1195
|
+
});
|
|
1196
|
+
let newrecord$3 = {...questionState};
|
|
1197
|
+
newrecord$3.consumed = questionState.consumed.map(e => {
|
|
1198
|
+
if (e.eventType === "ReplyPosted") {
|
|
1199
|
+
return {
|
|
1200
|
+
eventType: "ReplyPosted",
|
|
1201
|
+
idFields: [
|
|
1202
|
+
{
|
|
1203
|
+
name: "replyId",
|
|
1204
|
+
isList: false
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
name: "messageId",
|
|
1208
|
+
isList: false,
|
|
1209
|
+
declared: true,
|
|
1210
|
+
crossPartition: true
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
name: "channelId",
|
|
1214
|
+
isList: false
|
|
1215
|
+
}
|
|
1216
|
+
]
|
|
1217
|
+
};
|
|
1218
|
+
} else {
|
|
1219
|
+
return e;
|
|
1220
|
+
}
|
|
1221
|
+
});
|
|
1222
|
+
globalThis.test("marked @crossPartition, the question reads its replies as a pair", () => {
|
|
1223
|
+
let boundary = [
|
|
1224
|
+
postMessage,
|
|
1225
|
+
postReply,
|
|
1226
|
+
newrecord$3
|
|
1227
|
+
];
|
|
1228
|
+
let issues = DcbValidation$Reventless.validatePartitionHintsVsInference(boundary);
|
|
1229
|
+
globalThis.expect(issues.contradictions).toEqual([]);
|
|
1230
|
+
let d = DcbScopeInference$Reventless.infer(boundary);
|
|
1231
|
+
globalThis.expect(d.crossPartitionPairs).toEqual([{
|
|
1232
|
+
reader: "QuestionState",
|
|
1233
|
+
eventType: "ReplyPosted",
|
|
1234
|
+
key: "messageId",
|
|
1235
|
+
writers: ["PostReply"]
|
|
1236
|
+
}]);
|
|
1237
|
+
globalThis.expect(d.crossPartitionTagKeys).toEqual([]);
|
|
1238
|
+
let arms = DcbValidation$Reventless.validateCrossPartitionArms(boundary, d);
|
|
1239
|
+
globalThis.expect(arms.contradictions).toEqual([]);
|
|
1240
|
+
globalThis.expect(arms.redundancies).toEqual([]);
|
|
1241
|
+
});
|
|
1242
|
+
globalThis.test("a marker on a key that is not the slice's own is refused", () => {
|
|
1243
|
+
let newrecord = {...questionState};
|
|
1244
|
+
newrecord.consumed = questionState.consumed.map(e => {
|
|
1245
|
+
if (e.eventType === "ReplyPosted") {
|
|
1246
|
+
return {
|
|
1247
|
+
eventType: "ReplyPosted",
|
|
1248
|
+
idFields: [
|
|
1249
|
+
{
|
|
1250
|
+
name: "replyId",
|
|
1251
|
+
isList: false
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
name: "messageId",
|
|
1255
|
+
isList: false,
|
|
1256
|
+
declared: true,
|
|
1257
|
+
crossPartition: true
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
name: "channelId",
|
|
1261
|
+
isList: false,
|
|
1262
|
+
declared: true,
|
|
1263
|
+
crossPartition: true
|
|
1264
|
+
}
|
|
1265
|
+
]
|
|
1266
|
+
};
|
|
1267
|
+
} else {
|
|
1268
|
+
return e;
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
let boundary = [
|
|
1272
|
+
postMessage,
|
|
1273
|
+
postReply,
|
|
1274
|
+
newrecord
|
|
1275
|
+
];
|
|
1276
|
+
let arms = DcbValidation$Reventless.validateCrossPartitionArms(boundary, DcbScopeInference$Reventless.infer(boundary));
|
|
1277
|
+
globalThis.expect(arms.contradictions.map(e => e.sliceName)).toEqual(["QuestionState"]);
|
|
1278
|
+
globalThis.expect(arms.contradictions.every(e => e.message.includes("marks channelId"))).toBe(true);
|
|
1279
|
+
});
|
|
1280
|
+
globalThis.test("a marker on an event already stored under the slice's key is redundant", () => {
|
|
1281
|
+
let newrecord$4 = {...newrecord$3};
|
|
1282
|
+
newrecord$4.consumed = newrecord$3.consumed.map(e => {
|
|
1283
|
+
if (e.eventType === "MessagePosted") {
|
|
1284
|
+
return {
|
|
1285
|
+
eventType: "MessagePosted",
|
|
1286
|
+
idFields: [
|
|
1287
|
+
{
|
|
1288
|
+
name: "messageId",
|
|
1289
|
+
isList: false,
|
|
1290
|
+
declared: true,
|
|
1291
|
+
crossPartition: true
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
name: "channelId",
|
|
1295
|
+
isList: false
|
|
1296
|
+
}
|
|
1297
|
+
]
|
|
1298
|
+
};
|
|
1299
|
+
} else {
|
|
1300
|
+
return e;
|
|
1301
|
+
}
|
|
1302
|
+
});
|
|
1303
|
+
let boundary = [
|
|
1304
|
+
postMessage,
|
|
1305
|
+
postReply,
|
|
1306
|
+
newrecord$4
|
|
1307
|
+
];
|
|
1308
|
+
let d = DcbScopeInference$Reventless.infer(boundary);
|
|
1309
|
+
let arms = DcbValidation$Reventless.validateCrossPartitionArms(boundary, d);
|
|
1310
|
+
globalThis.expect(arms.contradictions).toEqual([]);
|
|
1311
|
+
globalThis.expect(arms.redundancies.map(e => e.sliceName)).toEqual(["QuestionState"]);
|
|
1312
|
+
globalThis.expect(d.crossPartitionPairs.map(p => p.eventType)).toEqual(["ReplyPosted"]);
|
|
1124
1313
|
});
|
|
1125
1314
|
globalThis.test("a hint naming a key one of the slice's events lacks is still a contradiction", () => {
|
|
1126
1315
|
let newrecord = {...questionState};
|
|
@@ -1198,6 +1387,7 @@ export {
|
|
|
1198
1387
|
DSI,
|
|
1199
1388
|
scal,
|
|
1200
1389
|
arr,
|
|
1390
|
+
cross,
|
|
1201
1391
|
ev,
|
|
1202
1392
|
slice,
|
|
1203
1393
|
addProduct,
|
|
@@ -198,7 +198,7 @@ globalThis.beforeEach(() => {
|
|
|
198
198
|
globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
199
199
|
globalThis.describe("handleCommands - happy path", () => {
|
|
200
200
|
globalThis.test("CreateItem on empty log succeeds", async () => {
|
|
201
|
-
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
201
|
+
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
202
202
|
TAG: "CreateItem",
|
|
203
203
|
itemId: "item-1",
|
|
204
204
|
name: "Test"
|
|
@@ -217,7 +217,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
217
217
|
]);
|
|
218
218
|
});
|
|
219
219
|
globalThis.test("stored event carries only its entity tags (no framework provenance tag)", async () => {
|
|
220
|
-
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
220
|
+
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
221
221
|
TAG: "CreateItem",
|
|
222
222
|
itemId: "item-1",
|
|
223
223
|
name: "Test"
|
|
@@ -231,7 +231,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
231
231
|
});
|
|
232
232
|
globalThis.describe("handleCommands - decide returns Ok([])", () => {
|
|
233
233
|
globalThis.test("NoOp returns Ok without storing events", async () => {
|
|
234
|
-
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-noop", "NoOp")])));
|
|
234
|
+
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-noop", "NoOp")])));
|
|
235
235
|
globalThis.expect([
|
|
236
236
|
results,
|
|
237
237
|
mock.getEvents().length
|
|
@@ -246,12 +246,12 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
246
246
|
});
|
|
247
247
|
globalThis.describe("handleCommands - decide returns Error", () => {
|
|
248
248
|
globalThis.test("CreateItem when item exists returns Ok (business-rule violations ACK, not NACK)", async () => {
|
|
249
|
-
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
249
|
+
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
250
250
|
TAG: "CreateItem",
|
|
251
251
|
itemId: "item-1",
|
|
252
252
|
name: "Test"
|
|
253
253
|
})])));
|
|
254
|
-
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-2", {
|
|
254
|
+
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-2", {
|
|
255
255
|
TAG: "CreateItem",
|
|
256
256
|
itemId: "item-1",
|
|
257
257
|
name: "Duplicate"
|
|
@@ -265,7 +265,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
265
265
|
globalThis.describe("handleCommands - retry on conflict", () => {
|
|
266
266
|
globalThis.test("retries and succeeds after 1 append failure", async () => {
|
|
267
267
|
mock.failNextAppends.contents = 1;
|
|
268
|
-
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
268
|
+
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
269
269
|
TAG: "CreateItem",
|
|
270
270
|
itemId: "item-1",
|
|
271
271
|
name: "Test"
|
|
@@ -283,7 +283,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
283
283
|
});
|
|
284
284
|
globalThis.test("returns Error after retries exhausted (4 failures)", async () => {
|
|
285
285
|
mock.failNextAppends.contents = 4;
|
|
286
|
-
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
286
|
+
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
287
287
|
TAG: "CreateItem",
|
|
288
288
|
itemId: "item-1",
|
|
289
289
|
name: "Test"
|
|
@@ -302,7 +302,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
302
302
|
});
|
|
303
303
|
globalThis.describe("handleCommands - read consistency (eventual-first, strong-on-retry)", () => {
|
|
304
304
|
globalThis.test("a conflict-free command reads eventually-consistent (no strong read)", async () => {
|
|
305
|
-
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
305
|
+
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
306
306
|
TAG: "CreateItem",
|
|
307
307
|
itemId: "item-1",
|
|
308
308
|
name: "Test"
|
|
@@ -311,7 +311,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
311
311
|
});
|
|
312
312
|
globalThis.test("escalates to strong consistency on retry after a conflict", async () => {
|
|
313
313
|
mock.failNextAppends.contents = 1;
|
|
314
|
-
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
314
|
+
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
315
315
|
TAG: "CreateItem",
|
|
316
316
|
itemId: "item-1",
|
|
317
317
|
name: "Test"
|
|
@@ -323,7 +323,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
323
323
|
});
|
|
324
324
|
globalThis.test("every retry after the first is strong (2 failures)", async () => {
|
|
325
325
|
mock.failNextAppends.contents = 2;
|
|
326
|
-
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
326
|
+
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
327
327
|
TAG: "CreateItem",
|
|
328
328
|
itemId: "item-1",
|
|
329
329
|
name: "Test"
|
|
@@ -337,7 +337,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
337
337
|
});
|
|
338
338
|
globalThis.describe("handleCommands - read consistency (per-slice override)", () => {
|
|
339
339
|
globalThis.test("AlwaysStrong reads strong on the first attempt", async () => {
|
|
340
|
-
await Effect.runPromise(StrongHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
340
|
+
await Effect.runPromise(StrongHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
341
341
|
TAG: "CreateItem",
|
|
342
342
|
itemId: "item-1",
|
|
343
343
|
name: "Test"
|
|
@@ -346,7 +346,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
346
346
|
});
|
|
347
347
|
globalThis.test("AlwaysStrong stays strong across retries (2 failures)", async () => {
|
|
348
348
|
mock.failNextAppends.contents = 2;
|
|
349
|
-
await Effect.runPromise(StrongHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
349
|
+
await Effect.runPromise(StrongHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
350
350
|
TAG: "CreateItem",
|
|
351
351
|
itemId: "item-1",
|
|
352
352
|
name: "Test"
|
|
@@ -359,7 +359,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
359
359
|
});
|
|
360
360
|
globalThis.test("AlwaysEventual never reads strong, even on retry (2 failures)", async () => {
|
|
361
361
|
mock.failNextAppends.contents = 2;
|
|
362
|
-
await Effect.runPromise(EventualHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
362
|
+
await Effect.runPromise(EventualHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
363
363
|
TAG: "CreateItem",
|
|
364
364
|
itemId: "item-1",
|
|
365
365
|
name: "Test"
|
|
@@ -373,12 +373,12 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
373
373
|
});
|
|
374
374
|
globalThis.describe("handleCommands - conditional append", () => {
|
|
375
375
|
globalThis.test("RenameItem after CreateItem uses headPosition in condition", async () => {
|
|
376
|
-
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
376
|
+
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-1", {
|
|
377
377
|
TAG: "CreateItem",
|
|
378
378
|
itemId: "item-1",
|
|
379
379
|
name: "Test"
|
|
380
380
|
})])));
|
|
381
|
-
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-2", {
|
|
381
|
+
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-2", {
|
|
382
382
|
TAG: "RenameItem",
|
|
383
383
|
itemId: "item-1",
|
|
384
384
|
newName: "Updated"
|
|
@@ -397,7 +397,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
397
397
|
});
|
|
398
398
|
globalThis.describe("handleCommands - batch", () => {
|
|
399
399
|
globalThis.test("multiple successful commands", async () => {
|
|
400
|
-
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([
|
|
400
|
+
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([
|
|
401
401
|
makeTopicItem("ref-1", {
|
|
402
402
|
TAG: "CreateItem",
|
|
403
403
|
itemId: "item-1",
|
|
@@ -421,12 +421,12 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
421
421
|
]);
|
|
422
422
|
});
|
|
423
423
|
globalThis.test("mixed: new item succeeds, duplicate item ACKs as Ok (business-rule violation)", async () => {
|
|
424
|
-
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-0", {
|
|
424
|
+
await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem("ref-0", {
|
|
425
425
|
TAG: "CreateItem",
|
|
426
426
|
itemId: "item-1",
|
|
427
427
|
name: "Existing"
|
|
428
428
|
})])));
|
|
429
|
-
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([
|
|
429
|
+
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([
|
|
430
430
|
makeTopicItem("ref-1", {
|
|
431
431
|
TAG: "CreateItem",
|
|
432
432
|
itemId: "item-2",
|
|
@@ -450,13 +450,13 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
450
450
|
]);
|
|
451
451
|
});
|
|
452
452
|
globalThis.test("empty batch returns empty array", async () => {
|
|
453
|
-
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([])));
|
|
453
|
+
let results = await Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([])));
|
|
454
454
|
globalThis.expect(results).toEqual([]);
|
|
455
455
|
});
|
|
456
456
|
});
|
|
457
457
|
globalThis.describe("handleCommands - projection cache", () => {
|
|
458
458
|
globalThis.test("a third same-entity command reads only the delta", async () => {
|
|
459
|
-
let run = (reference, command) => Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem(reference, command)])));
|
|
459
|
+
let run = (reference, command) => Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem(reference, command)])));
|
|
460
460
|
await run("ref-1", {
|
|
461
461
|
TAG: "CreateItem",
|
|
462
462
|
itemId: "item-1",
|
|
@@ -490,7 +490,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
490
490
|
]);
|
|
491
491
|
});
|
|
492
492
|
globalThis.test("a different entity does not hit another entity's cache (full read)", async () => {
|
|
493
|
-
let run = (reference, command) => Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem(reference, command)])));
|
|
493
|
+
let run = (reference, command) => Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem(reference, command)])));
|
|
494
494
|
await run("ref-1", {
|
|
495
495
|
TAG: "CreateItem",
|
|
496
496
|
itemId: "item-1",
|
|
@@ -507,7 +507,7 @@ globalThis.describe("StateChangeSlice_Callback:", () => {
|
|
|
507
507
|
]);
|
|
508
508
|
});
|
|
509
509
|
globalThis.test("conflict re-seeds the cache so the retry reads the delta", async () => {
|
|
510
|
-
let run = (reference, command) => Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem(reference, command)])));
|
|
510
|
+
let run = (reference, command) => Effect.runPromise(TestHandler.handleCommands(undefined, undefined, undefined, undefined, testDcbEventLog, Stream.fromIterable([makeTopicItem(reference, command)])));
|
|
511
511
|
await run("ref-1", {
|
|
512
512
|
TAG: "CreateItem",
|
|
513
513
|
itemId: "item-1",
|
package/tests/dcb/DcbTagTest.res
CHANGED
|
@@ -754,6 +754,74 @@ describe("DcbTag:", () => {
|
|
|
754
754
|
)->toEqual([{Reventless.DcbTag.eventTypes, tags: [{key: "orderId", value: "ord-1"}]}]),
|
|
755
755
|
)
|
|
756
756
|
|
|
757
|
+
// --- Pairs: the types a slice reads by its own key across partitions ---
|
|
758
|
+
|
|
759
|
+
let createItem = DcbFixtures.CreateItem({itemId: "item-1", name: "Test"})
|
|
760
|
+
let itemTag: Reventless.DcbTag.tag = {key: "itemId", value: "item-1"}
|
|
761
|
+
|
|
762
|
+
testSync(
|
|
763
|
+
"a pair's types leave the partition clause for one read across partitions",
|
|
764
|
+
() =>
|
|
765
|
+
expect(
|
|
766
|
+
Reventless.DcbTag.buildQueryFromCommand(
|
|
767
|
+
~eventTypes,
|
|
768
|
+
~schema=DcbFixtures.singleTagCommandSchema,
|
|
769
|
+
~value=createItem,
|
|
770
|
+
~pairEventTypes=Dict.fromArray([("itemId", ["EventB"])]),
|
|
771
|
+
),
|
|
772
|
+
)->toEqual([
|
|
773
|
+
{Reventless.DcbTag.eventTypes: ["EventA"], tags: [itemTag]},
|
|
774
|
+
{eventTypes: ["EventB"], tags: [itemTag], crossPartition: true},
|
|
775
|
+
]),
|
|
776
|
+
)
|
|
777
|
+
|
|
778
|
+
testSync(
|
|
779
|
+
"a clause of pair types only is read across partitions alone",
|
|
780
|
+
() =>
|
|
781
|
+
expect(
|
|
782
|
+
Reventless.DcbTag.buildQueryFromCommand(
|
|
783
|
+
~eventTypes,
|
|
784
|
+
~schema=DcbFixtures.singleTagCommandSchema,
|
|
785
|
+
~value=createItem,
|
|
786
|
+
~pairEventTypes=Dict.fromArray([("itemId", ["EventA", "EventB"])]),
|
|
787
|
+
),
|
|
788
|
+
)->toEqual([{Reventless.DcbTag.eventTypes, tags: [itemTag], crossPartition: true}]),
|
|
789
|
+
)
|
|
790
|
+
|
|
791
|
+
testSync(
|
|
792
|
+
"pairs on another key leave the clause as it is",
|
|
793
|
+
() =>
|
|
794
|
+
expect(
|
|
795
|
+
Reventless.DcbTag.buildQueryFromCommand(
|
|
796
|
+
~eventTypes,
|
|
797
|
+
~schema=DcbFixtures.singleTagCommandSchema,
|
|
798
|
+
~value=createItem,
|
|
799
|
+
~pairEventTypes=Dict.fromArray([("orderId", ["EventB"])]),
|
|
800
|
+
),
|
|
801
|
+
)->toEqual([{Reventless.DcbTag.eventTypes, tags: [itemTag]}]),
|
|
802
|
+
)
|
|
803
|
+
|
|
804
|
+
testSync(
|
|
805
|
+
"DcbScopeInference.pairEventTypes keeps the reader's pairs, by key",
|
|
806
|
+
() => {
|
|
807
|
+
let pair = (reader, eventType): Reventless.DcbScopeInference.pair => {
|
|
808
|
+
reader,
|
|
809
|
+
eventType,
|
|
810
|
+
key: "messageId",
|
|
811
|
+
writers: ["PostReply"],
|
|
812
|
+
}
|
|
813
|
+
expect(
|
|
814
|
+
[
|
|
815
|
+
pair("MarkAnswer", "ReplyPosted"),
|
|
816
|
+
pair("MarkAnswer", "ReplyEdited"),
|
|
817
|
+
pair("Other", "ReplyPosted"),
|
|
818
|
+
]
|
|
819
|
+
->Reventless.DcbScopeInference.pairEventTypes(~reader="MarkAnswer")
|
|
820
|
+
->Dict.toArray,
|
|
821
|
+
)->toEqual([("messageId", ["ReplyPosted", "ReplyEdited"])])
|
|
822
|
+
},
|
|
823
|
+
)
|
|
824
|
+
|
|
757
825
|
// --- Vacuous-clause narrowing (Issue 14) ---
|
|
758
826
|
|
|
759
827
|
let orderTagKeys = Reventless.DcbTag.extractTagKeysByEventType(DcbFixtures.orderEventLogSchema)
|
|
@@ -8,6 +8,7 @@ import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js
|
|
|
8
8
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
9
9
|
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
10
10
|
import * as DcbFixtures$ReventlessCore from "./DcbFixtures.res.mjs";
|
|
11
|
+
import * as DcbScopeInference$Reventless from "@reventlessdev/reventless-spec/src/components/DcbScopeInference.res.mjs";
|
|
11
12
|
|
|
12
13
|
globalThis.describe("DcbTag:", () => {
|
|
13
14
|
globalThis.describe("jsonValueToString", () => {
|
|
@@ -540,7 +541,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
540
541
|
TAG: "CreateItem",
|
|
541
542
|
itemId: "item-1",
|
|
542
543
|
name: "Test"
|
|
543
|
-
}, undefined, undefined, undefined)).toEqual([{
|
|
544
|
+
}, undefined, undefined, undefined, undefined)).toEqual([{
|
|
544
545
|
eventTypes: eventTypes,
|
|
545
546
|
tags: [{
|
|
546
547
|
key: "itemId",
|
|
@@ -557,7 +558,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
557
558
|
"prod-1",
|
|
558
559
|
"prod-2"
|
|
559
560
|
]
|
|
560
|
-
}, undefined, undefined, undefined)).toEqual([
|
|
561
|
+
}, undefined, undefined, undefined, undefined)).toEqual([
|
|
561
562
|
{
|
|
562
563
|
eventTypes: eventTypes,
|
|
563
564
|
tags: [{
|
|
@@ -587,7 +588,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
587
588
|
orderId: "ord-1",
|
|
588
589
|
customerId: "cust-1",
|
|
589
590
|
productId: ["prod-1"]
|
|
590
|
-
}, undefined, undefined, undefined)).toEqual([
|
|
591
|
+
}, undefined, undefined, undefined, undefined)).toEqual([
|
|
591
592
|
{
|
|
592
593
|
eventTypes: eventTypes,
|
|
593
594
|
tags: [{
|
|
@@ -610,7 +611,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
610
611
|
orderId: "ord-1",
|
|
611
612
|
customerId: "cust-1",
|
|
612
613
|
productId: []
|
|
613
|
-
}, undefined, undefined, undefined)).toEqual([{
|
|
614
|
+
}, undefined, undefined, undefined, undefined)).toEqual([{
|
|
614
615
|
eventTypes: eventTypes,
|
|
615
616
|
tags: [{
|
|
616
617
|
key: "orderId",
|
|
@@ -618,6 +619,81 @@ globalThis.describe("DcbTag:", () => {
|
|
|
618
619
|
}]
|
|
619
620
|
}]);
|
|
620
621
|
});
|
|
622
|
+
let createItem = {
|
|
623
|
+
TAG: "CreateItem",
|
|
624
|
+
itemId: "item-1",
|
|
625
|
+
name: "Test"
|
|
626
|
+
};
|
|
627
|
+
let itemTag = {
|
|
628
|
+
key: "itemId",
|
|
629
|
+
value: "item-1"
|
|
630
|
+
};
|
|
631
|
+
globalThis.test("a pair's types leave the partition clause for one read across partitions", () => {
|
|
632
|
+
globalThis.expect(DcbTag$Reventless.buildQueryFromCommand(eventTypes, DcbFixtures$ReventlessCore.singleTagCommandSchema, createItem, undefined, undefined, undefined, Object.fromEntries([[
|
|
633
|
+
"itemId",
|
|
634
|
+
["EventB"]
|
|
635
|
+
]]))).toEqual([
|
|
636
|
+
{
|
|
637
|
+
eventTypes: ["EventA"],
|
|
638
|
+
tags: [itemTag]
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
eventTypes: ["EventB"],
|
|
642
|
+
tags: [itemTag],
|
|
643
|
+
crossPartition: true
|
|
644
|
+
}
|
|
645
|
+
]);
|
|
646
|
+
});
|
|
647
|
+
globalThis.test("a clause of pair types only is read across partitions alone", () => {
|
|
648
|
+
globalThis.expect(DcbTag$Reventless.buildQueryFromCommand(eventTypes, DcbFixtures$ReventlessCore.singleTagCommandSchema, createItem, undefined, undefined, undefined, Object.fromEntries([[
|
|
649
|
+
"itemId",
|
|
650
|
+
[
|
|
651
|
+
"EventA",
|
|
652
|
+
"EventB"
|
|
653
|
+
]
|
|
654
|
+
]]))).toEqual([{
|
|
655
|
+
eventTypes: eventTypes,
|
|
656
|
+
tags: [itemTag],
|
|
657
|
+
crossPartition: true
|
|
658
|
+
}]);
|
|
659
|
+
});
|
|
660
|
+
globalThis.test("pairs on another key leave the clause as it is", () => {
|
|
661
|
+
globalThis.expect(DcbTag$Reventless.buildQueryFromCommand(eventTypes, DcbFixtures$ReventlessCore.singleTagCommandSchema, createItem, undefined, undefined, undefined, Object.fromEntries([[
|
|
662
|
+
"orderId",
|
|
663
|
+
["EventB"]
|
|
664
|
+
]]))).toEqual([{
|
|
665
|
+
eventTypes: eventTypes,
|
|
666
|
+
tags: [itemTag]
|
|
667
|
+
}]);
|
|
668
|
+
});
|
|
669
|
+
globalThis.test("DcbScopeInference.pairEventTypes keeps the reader's pairs, by key", () => {
|
|
670
|
+
globalThis.expect(Object.entries(DcbScopeInference$Reventless.pairEventTypes([
|
|
671
|
+
{
|
|
672
|
+
reader: "MarkAnswer",
|
|
673
|
+
eventType: "ReplyPosted",
|
|
674
|
+
key: "messageId",
|
|
675
|
+
writers: ["PostReply"]
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
reader: "MarkAnswer",
|
|
679
|
+
eventType: "ReplyEdited",
|
|
680
|
+
key: "messageId",
|
|
681
|
+
writers: ["PostReply"]
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
reader: "Other",
|
|
685
|
+
eventType: "ReplyPosted",
|
|
686
|
+
key: "messageId",
|
|
687
|
+
writers: ["PostReply"]
|
|
688
|
+
}
|
|
689
|
+
], "MarkAnswer"))).toEqual([[
|
|
690
|
+
"messageId",
|
|
691
|
+
[
|
|
692
|
+
"ReplyPosted",
|
|
693
|
+
"ReplyEdited"
|
|
694
|
+
]
|
|
695
|
+
]]);
|
|
696
|
+
});
|
|
621
697
|
let orderTagKeys = DcbTag$Reventless.extractTagKeysByEventType(DcbFixtures$ReventlessCore.orderEventLogSchema);
|
|
622
698
|
globalThis.test("extractTagKeysByEventType maps each event type to its produced tag keys", () => {
|
|
623
699
|
globalThis.expect(Object.entries(orderTagKeys).toSorted((param, param$1) => Primitive_string.compare(param[0], param$1[0]))).toEqual([
|
|
@@ -644,7 +720,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
644
720
|
orderId: "ord-1",
|
|
645
721
|
customerId: "cust-1",
|
|
646
722
|
productId: ["prod-1"]
|
|
647
|
-
}, orderTagKeys, undefined, undefined)).toEqual([
|
|
723
|
+
}, orderTagKeys, undefined, undefined, undefined)).toEqual([
|
|
648
724
|
{
|
|
649
725
|
eventTypes: ["OrderPlaced"],
|
|
650
726
|
tags: [{
|
|
@@ -672,7 +748,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
672
748
|
TAG: "CreateItem",
|
|
673
749
|
itemId: "item-1",
|
|
674
750
|
name: "Test"
|
|
675
|
-
}, orderTagKeys, undefined, undefined)).toEqual([{
|
|
751
|
+
}, orderTagKeys, undefined, undefined, undefined)).toEqual([{
|
|
676
752
|
eventTypes: [],
|
|
677
753
|
tags: [{
|
|
678
754
|
key: "itemId",
|
|
@@ -689,7 +765,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
689
765
|
orderId: "ord-1",
|
|
690
766
|
customerId: "cust-1",
|
|
691
767
|
productId: ["prod-1"]
|
|
692
|
-
}, {}, undefined, undefined)).toEqual([
|
|
768
|
+
}, {}, undefined, undefined, undefined)).toEqual([
|
|
693
769
|
{
|
|
694
770
|
eventTypes: [
|
|
695
771
|
"OrderPlaced",
|
|
@@ -723,7 +799,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
723
799
|
TAG: "SubscribeStudent",
|
|
724
800
|
courseId: "C1",
|
|
725
801
|
studentId: "S1"
|
|
726
|
-
}, undefined, ["studentId"], undefined)).toEqual([
|
|
802
|
+
}, undefined, ["studentId"], undefined, undefined)).toEqual([
|
|
727
803
|
{
|
|
728
804
|
eventTypes: ["StudentSubscribed"],
|
|
729
805
|
tags: [{
|
|
@@ -745,7 +821,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
745
821
|
TAG: "SubscribeStudent",
|
|
746
822
|
courseId: "C1",
|
|
747
823
|
studentId: "S1"
|
|
748
|
-
}, undefined, undefined, undefined)).toEqual([{
|
|
824
|
+
}, undefined, undefined, undefined, undefined)).toEqual([{
|
|
749
825
|
eventTypes: ["StudentSubscribed"],
|
|
750
826
|
tags: [
|
|
751
827
|
{
|
|
@@ -813,7 +889,7 @@ globalThis.describe("DcbTag:", () => {
|
|
|
813
889
|
"prod-1",
|
|
814
890
|
"prod-2"
|
|
815
891
|
]
|
|
816
|
-
}, undefined, undefined, undefined)).toEqual([
|
|
892
|
+
}, undefined, undefined, undefined, undefined)).toEqual([
|
|
817
893
|
{
|
|
818
894
|
eventTypes: [
|
|
819
895
|
"OrderPlaced",
|
|
@@ -417,7 +417,7 @@ globalThis.describe("DcbValidation:", () => {
|
|
|
417
417
|
TAG: "RecordDemand",
|
|
418
418
|
productId: "p1",
|
|
419
419
|
orderId: "o1"
|
|
420
|
-
}, undefined, ["orderId"], undefined);
|
|
420
|
+
}, undefined, ["orderId"], undefined, undefined);
|
|
421
421
|
globalThis.expect(query.every(qi => Stdlib_Option.mapOr(qi.tags, 0, prim => prim.length) === 1)).toBe(true);
|
|
422
422
|
});
|
|
423
423
|
globalThis.test("no warnings when nothing reads compositely", () => {
|