@ibgib/core-gib 0.1.60 → 0.1.61
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 +3 -0
- package/dist/common/other/graph-helper.d.mts.map +1 -1
- package/dist/common/other/graph-helper.mjs +7 -6
- package/dist/common/other/graph-helper.mjs.map +1 -1
- package/dist/keystone/keystone-config-builder.d.mts +1 -2
- package/dist/keystone/keystone-config-builder.d.mts.map +1 -1
- package/dist/keystone/keystone-config-builder.mjs +4 -19
- package/dist/keystone/keystone-config-builder.mjs.map +1 -1
- package/dist/keystone/keystone-constants.d.mts +2 -0
- package/dist/keystone/keystone-constants.d.mts.map +1 -1
- package/dist/keystone/keystone-constants.mjs +2 -0
- package/dist/keystone/keystone-constants.mjs.map +1 -1
- package/dist/keystone/keystone-helpers.d.mts +5 -15
- package/dist/keystone/keystone-helpers.d.mts.map +1 -1
- package/dist/keystone/keystone-helpers.mjs +59 -73
- package/dist/keystone/keystone-helpers.mjs.map +1 -1
- package/dist/keystone/keystone-policy-types.d.mts +6 -4
- package/dist/keystone/keystone-policy-types.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.mjs +4 -8
- package/dist/keystone/keystone-service-v1.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.respec.mjs +182 -33
- package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
- package/dist/keystone/keystone-types.d.mts +4 -11
- package/dist/keystone/keystone-types.d.mts.map +1 -1
- package/dist/keystone/policy/keystone-profile-builder.d.mts +25 -0
- package/dist/keystone/policy/keystone-profile-builder.d.mts.map +1 -0
- package/dist/keystone/policy/keystone-profile-builder.mjs +117 -0
- package/dist/keystone/policy/keystone-profile-builder.mjs.map +1 -0
- package/dist/keystone/policy/profiles/profile-high.json +84 -0
- package/dist/keystone/policy/profiles/profile-low.json +84 -0
- package/dist/keystone/policy/profiles/profile-medium.json +84 -0
- package/dist/keystone/policy/profiles/profile-session.json +84 -0
- package/dist/keystone/policy/profiles/profile-test.json +84 -0
- package/dist/keystone/policy/schemas/connect-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/connect-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/connect-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/keystone.high.schema.json +26 -0
- package/dist/keystone/policy/schemas/keystone.low.schema.json +26 -0
- package/dist/keystone/policy/schemas/keystone.medium.schema.json +26 -0
- package/dist/keystone/policy/schemas/manage-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/manage-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/manage-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/revoke-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/revoke-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/revoke-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/sign-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/sign-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/sign-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/sync-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/sync-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/sync-pool.medium.schema.json +23 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.d.mts +8 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs +582 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.d.mts +7 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs +274 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.d.mts +8 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs +322 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.d.mts +7 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.mjs +307 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.d.mts +8 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.mjs +233 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs +233 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs +225 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs +235 -0
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs +211 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace.withid.respec.d.mts +8 -0
- package/dist/sync/sync-innerspace.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace.withid.respec.mjs +260 -0
- package/dist/sync/sync-innerspace.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.d.mts +1 -0
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mjs +13 -4
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.d.mts +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs +5 -3
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs.map +1 -1
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.mjs +165 -145
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
- package/dist/sync/sync-withid.pingpong.respec.mjs +8 -8
- package/dist/sync/sync-withid.pingpong.respec.mjs.map +1 -1
- package/dist/timeline/timeline-api.d.mts.map +1 -1
- package/dist/timeline/timeline-api.mjs +1 -14
- package/dist/timeline/timeline-api.mjs.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-base.d.mts.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-base.mjs +0 -40
- package/dist/witness/space/reconciliation-space/reconciliation-space-base.mjs.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-helper.d.mts.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-helper.mjs +6 -6
- package/dist/witness/space/reconciliation-space/reconciliation-space-helper.mjs.map +1 -1
- package/ibgib-foundations.md +2 -1
- package/package.json +1 -1
- package/src/common/other/graph-helper.mts +7 -6
- package/src/keystone/README.md +19 -15
- package/src/keystone/docs/CRYPTANALYSIS.md +185 -0
- package/src/keystone/docs/architecture.md +24 -1
- package/src/keystone/docs/profiles.md +124 -0
- package/src/keystone/keystone-config-builder.mts +3 -21
- package/src/keystone/keystone-constants.mts +2 -0
- package/src/keystone/keystone-helpers.mts +74 -77
- package/src/keystone/keystone-policy-types.mts +6 -4
- package/src/keystone/keystone-service-v1.mts +4 -9
- package/src/keystone/keystone-service-v1.respec.mts +214 -32
- package/src/keystone/keystone-types.mts +5 -9
- package/src/keystone/policy/IMPLEMENTATION.md +60 -0
- package/src/keystone/policy/README.md +94 -0
- package/src/keystone/policy/keystone-profile-builder.mts +131 -0
- package/src/keystone/policy/profiles/profile-high.json +84 -0
- package/src/keystone/policy/profiles/profile-low.json +84 -0
- package/src/keystone/policy/profiles/profile-medium.json +84 -0
- package/src/keystone/policy/profiles/profile-session.json +84 -0
- package/src/keystone/policy/profiles/profile-test.json +84 -0
- package/src/keystone/policy/schemas/connect-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/connect-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/connect-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/keystone.high.schema.json +26 -0
- package/src/keystone/policy/schemas/keystone.low.schema.json +26 -0
- package/src/keystone/policy/schemas/keystone.medium.schema.json +26 -0
- package/src/keystone/policy/schemas/manage-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/manage-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/manage-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/revoke-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/revoke-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/revoke-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/sign-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/sign-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/sign-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/sync-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/sync-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/sync-pool.medium.schema.json +23 -0
- package/src/sync/docs/security.md +54 -21
- package/src/sync/sync-conflict-adv-multitimelines.withid.respec.mts +706 -0
- package/src/sync/sync-conflict-basic-divergence.withid.respec.mts +321 -0
- package/src/sync/sync-conflict-basic-multitimelines.withid.respec.mts +374 -0
- package/src/sync/sync-conflict-text-merge.withid.respec.mts +347 -0
- package/src/sync/sync-innerspace-constants.withid.respec.mts +264 -0
- package/src/sync/sync-innerspace-deep-updates.withid.respec.mts +272 -0
- package/src/sync/sync-innerspace-dest-ahead.withid.respec.mts +266 -0
- package/src/sync/sync-innerspace-multiple-timelines.respec.mts +0 -1
- package/src/sync/sync-innerspace-multiple-timelines.withid.respec.mts +273 -0
- package/src/sync/sync-innerspace-partial-update.withid.respec.mts +249 -0
- package/src/sync/sync-innerspace.withid.respec.mts +265 -0
- package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mts +12 -4
- package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mts +5 -3
- package/src/sync/sync-saga-coordinator.mts +159 -143
- package/src/sync/sync-withid.pingpong.respec.mts +8 -8
- package/src/timeline/timeline-api.mts +1 -15
- package/src/timeline/timeline-api.respec.mts +3 -3
- package/src/witness/space/reconciliation-space/reconciliation-space-base.mts +0 -46
- package/src/witness/space/reconciliation-space/reconciliation-space-helper.mts +6 -5
- package/tsconfig.json +6 -1
- package/src/keystone/keystone-policy.schema.json +0 -51
- package/src/witness/space/reconciliation-space/reconciliation-space-base.mts.OLD.md +0 -884
- package/src/witness/space/reconciliation-space/reconciliation-space-helper.mts.OLD.md +0 -125
|
@@ -466,154 +466,158 @@ export class SyncSagaCoordinator {
|
|
|
466
466
|
}));
|
|
467
467
|
// #endregion set up peer observable for any domainPayloadsMap
|
|
468
468
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
469
|
+
try {
|
|
470
|
+
// ...create/compose the Request Context itself...
|
|
471
|
+
const requestCtx = await this.createSyncSagaContext({
|
|
472
|
+
sagaFrame: currentFrame,
|
|
473
|
+
/**
|
|
474
|
+
* init frame: empty
|
|
475
|
+
* ack frame: possible push offers
|
|
476
|
+
* delta frame: requested ibgibs or commit offer
|
|
477
|
+
* commit frame: empty
|
|
478
|
+
*/
|
|
479
|
+
payloadIbGibsDomain: nextDomainIbGibs,
|
|
480
|
+
localSpace,
|
|
481
|
+
metaspace,
|
|
482
|
+
sessionIdentityAddr: peer.currentSessionIdentityAddr,
|
|
483
|
+
peer,
|
|
484
|
+
});
|
|
484
485
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
486
|
+
// #region Log what we're sending
|
|
487
|
+
if (logalotControlDomain) {
|
|
488
|
+
const domainAddrs = nextDomainIbGibs.map(p => getIbGibAddr({ ibGib: p }));
|
|
489
|
+
console.log(`${lc}${lcControlDomain} SENDER TRANSMIT -> peer.witness (I: 5b0081803698770f0bf64992220b312)`);
|
|
490
|
+
console.log(`${lc}${lcControlDomain} Context: ${getIbGibAddr({ ibGib: requestCtx })}`);
|
|
491
|
+
console.log(`${lc}${lcControlDomain} Frame: ${getIbGibAddr({ ibGib: currentFrame })}`);
|
|
492
|
+
console.log(`${lc}${lcControlDomain} DOMAIN Payloads (${domainAddrs.length}): ${domainAddrs.join(', ') || '(none)'}`);
|
|
493
|
+
}
|
|
494
|
+
// #endregion Log what we're sending
|
|
495
|
+
|
|
496
|
+
// update our saga listeners...
|
|
497
|
+
// if (logalot) { console.log(`${lc} transmitting... requestCtx: ${pretty(requestCtx)} (I: 8cf20817c66899abdb1e76df50356826)`); }
|
|
498
|
+
updates$.next(requestCtx); // spins off for saga UI updates
|
|
499
|
+
|
|
500
|
+
// ...And send the context.
|
|
501
|
+
peer.setOptionalOpts({ localSpace, localTempSpace: tempSpace, });
|
|
502
|
+
const responseCtx = await peer.witness(requestCtx);
|
|
503
|
+
|
|
504
|
+
// the send returned, but a peer can return a falsy responseCtx, if
|
|
505
|
+
// we just sent a commit to them and they're done. If so, there will
|
|
506
|
+
// necessarily be no payload to wait to receive
|
|
507
|
+
if (!responseCtx) {
|
|
508
|
+
if (currentFrame) {
|
|
509
|
+
// Check for Commit (Peer silence expected)
|
|
510
|
+
const msg = await getSyncSagaMessageFromFrame({ frameIbGib: currentFrame, space: localSpace });
|
|
511
|
+
if (msg?.data?.stage === SyncStage.commit) {
|
|
512
|
+
if (logalot) { console.log(`${lc} Sender sent Commit. Peer returned no response. Saga Complete. (I: 26f9ee073858ca78b8284753368b5226)`); }
|
|
513
|
+
currentFrame = null;
|
|
514
|
+
break;
|
|
515
|
+
} else {
|
|
516
|
+
throw new Error(`(UNEXPECTED) responseCtx falsy and currentFrame truthy, but we're not in the commit stage? This may be expected ultimately, but atow I am not seeing this as being expected. (E: cc34498962bd370deeff351fac939f26)`);
|
|
517
|
+
}
|
|
514
518
|
} else {
|
|
515
|
-
throw new Error(`(UNEXPECTED)
|
|
519
|
+
throw new Error(`(UNEXPECTED) no response and currentFrame falsy? (E: 8d1085ea2f28cfc3f9c922649864a826)`);
|
|
516
520
|
}
|
|
517
|
-
} else {
|
|
518
|
-
throw new Error(`(UNEXPECTED) no response and currentFrame falsy? (E: 8d1085ea2f28cfc3f9c922649864a826)`);
|
|
519
521
|
}
|
|
520
|
-
}
|
|
521
522
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
523
|
+
// at this point, we did indeed receive a response to analyze. BUT!
|
|
524
|
+
// we have only necessarily received the response context ibgib.
|
|
525
|
+
// if there were payloads expected to be transferred, they may not
|
|
526
|
+
// be done yet.
|
|
526
527
|
|
|
527
|
-
|
|
528
|
-
|
|
528
|
+
if (!responseCtx.data) { throw new Error(`(UNEXPECTED) responseCtx.data falsy? (E: a969992bae53ab18a827ec58aec15826)`); }
|
|
529
|
+
updates$.next(responseCtx); // spins off for saga UI updating
|
|
529
530
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
// Turn-by-turn continuation & identity checks
|
|
537
|
-
const returnContextErrors = await this.validateReturnContext({
|
|
538
|
-
requestCtx,
|
|
539
|
-
responseCtx,
|
|
540
|
-
localSpace,
|
|
541
|
-
});
|
|
542
|
-
if (returnContextErrors.length > 0) {
|
|
543
|
-
throw new Error(`validateReturnContext errors: ${returnContextErrors.join(', ')} (E: cb8a023b9d0728cceb09fa3da0bb8226)`);
|
|
544
|
-
}
|
|
531
|
+
// immediately validate context/saga frame (but not payloads because
|
|
532
|
+
// we may not have those yet)
|
|
533
|
+
const contextAndSagaFrameValidationErrors =
|
|
534
|
+
await validateContextAndSagaFrame({ context: responseCtx });
|
|
535
|
+
if (contextAndSagaFrameValidationErrors.length > 0) { throw new Error(`contextAndSagaFrameValidationErrors: ${contextAndSagaFrameValidationErrors} (E: 6eebe8e7fa437c00a8cde3ada3c66826)`); }
|
|
545
536
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
responseCtx.payloadIbGibsDomain = await this.pollForDomainPayloads({
|
|
552
|
-
expectedAddrs: responsePayloadAddrsDomain,
|
|
553
|
-
pollIntervalMs: 20, // relatively arbitrary right now
|
|
554
|
-
domainPayloadsMap,
|
|
555
|
-
tempSpace,
|
|
537
|
+
// Turn-by-turn continuation & identity checks
|
|
538
|
+
const returnContextErrors = await this.validateReturnContext({
|
|
539
|
+
requestCtx,
|
|
540
|
+
responseCtx,
|
|
541
|
+
localSpace,
|
|
556
542
|
});
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
if (!responseCtx.sagaFrame) { throw new Error(`(UNEXPECTED) responseCtx.sagaFrame falsy? the Peer should have set this when it got the response back from the remote. (E: e650adadf9a2063ec6764a1e31d3d826)`); }
|
|
561
|
-
if (logalotControlDomain) {
|
|
562
|
-
const responseControlAddrs = responseCtx.data?.['@payloadAddrsControl'] as string[] || [];
|
|
563
|
-
console.log(`${lc}${lcControlDomain} SENDER RECEIVED <- peer.witness (I: 3dc76a9744d89a4fc3e2f076c2be4826)`);
|
|
564
|
-
console.log(`${lc}${lcControlDomain} Response Context: ${getIbGibAddr({ ibGib: responseCtx })}`);
|
|
565
|
-
console.log(`${lc}${lcControlDomain} Response Saga Frame: ${getIbGibAddr({ ibGib: responseCtx.sagaFrame })}`);
|
|
566
|
-
console.log(`${lc}${lcControlDomain} CONTROL Payloads (${responseControlAddrs.length}): ${responseControlAddrs.join(', ') || '(none)'}`);
|
|
567
|
-
console.log(`${lc}${lcControlDomain} DOMAIN Payloads (${responsePayloadAddrsDomain.length}): ${responsePayloadAddrsDomain.join(', ') || '(none)'}`);
|
|
568
|
-
}
|
|
569
|
-
// #endregion Log what we received back
|
|
543
|
+
if (returnContextErrors.length > 0) {
|
|
544
|
+
throw new Error(`validateReturnContext errors: ${returnContextErrors.join(', ')} (E: cb8a023b9d0728cceb09fa3da0bb8226)`);
|
|
545
|
+
}
|
|
570
546
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
// iteration in the saga loop
|
|
547
|
+
// Extract expected domain addresses from response context
|
|
548
|
+
const responsePayloadAddrsDomain = responseCtx.data[SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN] as string[] || [];
|
|
574
549
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
});
|
|
550
|
+
// Poll for them if needed. see above jsdocs for domainPayloadsMap
|
|
551
|
+
if (responsePayloadAddrsDomain.length > 0) {
|
|
552
|
+
responseCtx.payloadIbGibsDomain = await this.pollForDomainPayloads({
|
|
553
|
+
expectedAddrs: responsePayloadAddrsDomain,
|
|
554
|
+
pollIntervalMs: 20, // relatively arbitrary right now
|
|
555
|
+
domainPayloadsMap,
|
|
556
|
+
tempSpace,
|
|
557
|
+
});
|
|
558
|
+
}
|
|
585
559
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
560
|
+
// #region Log what we received back
|
|
561
|
+
if (!responseCtx.sagaFrame) { throw new Error(`(UNEXPECTED) responseCtx.sagaFrame falsy? the Peer should have set this when it got the response back from the remote. (E: e650adadf9a2063ec6764a1e31d3d826)`); }
|
|
562
|
+
if (logalotControlDomain) {
|
|
563
|
+
const responseControlAddrs = responseCtx.data?.['@payloadAddrsControl'] as string[] || [];
|
|
564
|
+
console.log(`${lc}${lcControlDomain} SENDER RECEIVED <- peer.witness (I: 3dc76a9744d89a4fc3e2f076c2be4826)`);
|
|
565
|
+
console.log(`${lc}${lcControlDomain} Response Context: ${getIbGibAddr({ ibGib: responseCtx })}`);
|
|
566
|
+
console.log(`${lc}${lcControlDomain} Response Saga Frame: ${getIbGibAddr({ ibGib: responseCtx.sagaFrame })}`);
|
|
567
|
+
console.log(`${lc}${lcControlDomain} CONTROL Payloads (${responseControlAddrs.length}): ${responseControlAddrs.join(', ') || '(none)'}`);
|
|
568
|
+
console.log(`${lc}${lcControlDomain} DOMAIN Payloads (${responsePayloadAddrsDomain.length}): ${responsePayloadAddrsDomain.join(', ') || '(none)'}`);
|
|
569
|
+
}
|
|
570
|
+
// #endregion Log what we received back
|
|
571
|
+
|
|
572
|
+
// at this point, we have received the context AND **all** of the
|
|
573
|
+
// domain payloads (if applicable), so we are ready to do the next
|
|
574
|
+
// iteration in the saga loop
|
|
575
|
+
|
|
576
|
+
// this is the part that drives the FSM forward, i.e., when we
|
|
577
|
+
// evolve the sync saga ibgib itself to the next frame if we aren't
|
|
578
|
+
// finished/errored out.
|
|
579
|
+
const contextResult = await this.handleResponseSagaContext({
|
|
580
|
+
sagaContext: responseCtx,
|
|
581
|
+
initDomainGraph,
|
|
582
|
+
mySpace: localSpace,
|
|
583
|
+
myTempSpace: tempSpace,
|
|
584
|
+
metaspace,
|
|
585
|
+
});
|
|
594
586
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
587
|
+
if (!contextResult) {
|
|
588
|
+
// should this ever hit?
|
|
589
|
+
console.error(`${lc} NAG ERROR (DOES NOT THROW): does this ever hit now? (E: e04d02efc2a8e72a88b79f1f0f95ca26)`);
|
|
590
|
+
break;
|
|
591
|
+
} else if (contextResult.nextFrameInfo?.sagaComplete) {
|
|
592
|
+
if (logalot) { console.log(`${lc} Handler returned null (Saga End). (I: 123bf9e7dca8886de72553a8d4f29e26)`); }
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
602
595
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
596
|
+
// #region error conditions throw
|
|
597
|
+
if (contextResult.errorMsg) {
|
|
598
|
+
throw new Error(`Couldn't handle response saga context. errorMsg: ${contextResult.errorMsg} (E: c948e81d513b2a0eb8b8afa878edc626)`);
|
|
599
|
+
} else if (!contextResult.nextFrameInfo) {
|
|
600
|
+
throw new Error(`(UNEXPECTED) contextResult.nextFrameInfo falsy? (E: c287a82e823e662a77923278e2418826)`);
|
|
601
|
+
}
|
|
602
|
+
// #endregion error conditions throw
|
|
603
|
+
|
|
604
|
+
// we have another frame to process and send out, with possibly
|
|
605
|
+
// payload domain ibgibs as well
|
|
606
|
+
const { frame, payloadIbGibsDomain, } = contextResult.nextFrameInfo;
|
|
607
|
+
currentFrame = frame;
|
|
608
|
+
nextDomainIbGibs = [...(payloadIbGibsDomain || [])];
|
|
609
|
+
|
|
610
|
+
// #region Log handler output for next iteration
|
|
611
|
+
if (logalotControlDomain) {
|
|
612
|
+
const handlerDomainAddrs = nextDomainIbGibs.map(p => getIbGibAddr({ ibGib: p }));
|
|
613
|
+
console.log(`${lc}${lcControlDomain} HANDLER RESULT -> next iteration (I: 6b0d88c4c28857ccd812381515bd7826)`);
|
|
614
|
+
console.log(`${lc}${lcControlDomain} Next Frame: ${getIbGibAddr({ ibGib: currentFrame })}`);
|
|
615
|
+
console.log(`${lc}${lcControlDomain} DOMAIN for next (${handlerDomainAddrs.length}): ${handlerDomainAddrs.join(', ') || '(none)'}`);
|
|
616
|
+
}
|
|
617
|
+
// #endregion Log handler output for next iteration
|
|
618
|
+
} finally {
|
|
619
|
+
await subscription.unsubscribe();
|
|
615
620
|
}
|
|
616
|
-
// #endregion Log handler output for next iteration
|
|
617
621
|
}
|
|
618
622
|
}
|
|
619
623
|
|
|
@@ -1033,7 +1037,8 @@ export class SyncSagaCoordinator {
|
|
|
1033
1037
|
|
|
1034
1038
|
let resultDomainPayloads: IbGib_V1[] = [];
|
|
1035
1039
|
|
|
1036
|
-
|
|
1040
|
+
const uniqueExpectedAddrs = [...new Set(expectedAddrs)];
|
|
1041
|
+
let pending = [...uniqueExpectedAddrs];
|
|
1037
1042
|
const start = Date.now();
|
|
1038
1043
|
/**
|
|
1039
1044
|
* This needs
|
|
@@ -1067,8 +1072,8 @@ export class SyncSagaCoordinator {
|
|
|
1067
1072
|
if (pending.length > 0) { await delay(pollIntervalMs); }
|
|
1068
1073
|
}
|
|
1069
1074
|
|
|
1070
|
-
if (
|
|
1071
|
-
throw new Error(`(UNEXPECTED)
|
|
1075
|
+
if (uniqueExpectedAddrs.length !== resultDomainPayloads.length) {
|
|
1076
|
+
throw new Error(`(UNEXPECTED) uniqueExpectedAddrs.length !== resultDomainPayloads.length? at this point, we expect all of the payload ibgibs to have been received. (E: 03749a7478c4b8b28bfc86951887a826)`);
|
|
1072
1077
|
}
|
|
1073
1078
|
|
|
1074
1079
|
return resultDomainPayloads;
|
|
@@ -1662,12 +1667,10 @@ export class SyncSagaCoordinator {
|
|
|
1662
1667
|
*/
|
|
1663
1668
|
const outgoingPayloadIbGibsDomain_conflicts: IbGib_V1[] = [];
|
|
1664
1669
|
|
|
1670
|
+
const activeConflicts: SyncSagaConflictInfo[] = [];
|
|
1665
1671
|
if (conflicts.length > 0) {
|
|
1666
1672
|
if (logalot) { console.log(`${lc} [CONFLICT DEBUG] Processing ${conflicts.length} non-terminal conflicts`); }
|
|
1667
1673
|
|
|
1668
|
-
// we will need to resolve conflicts, so no commit yet
|
|
1669
|
-
proposeCommit = false;
|
|
1670
|
-
|
|
1671
1674
|
for (const conflict of conflicts) {
|
|
1672
1675
|
const {
|
|
1673
1676
|
receiverTipAddr,
|
|
@@ -1739,11 +1742,24 @@ export class SyncSagaCoordinator {
|
|
|
1739
1742
|
const deltaPayloadIbGib = deltaGraph[deltaPayloadAddr];
|
|
1740
1743
|
outgoingPayloadIbGibsDomain_conflicts.push(deltaPayloadIbGib);
|
|
1741
1744
|
});
|
|
1742
|
-
|
|
1743
|
-
|
|
1745
|
+
|
|
1746
|
+
const isFastForward = latestCommonFrameAddr === receiverTipAddr;
|
|
1747
|
+
if (isFastForward) {
|
|
1748
|
+
if (logalot) { console.log(`${lc} [CONFLICT DEBUG] TJP ${tjpAddr}: Fast-forward detected (receiver behind sender). Excluding from active conflicts and sending delta payload.`); }
|
|
1749
|
+
} else {
|
|
1750
|
+
if (conflict.accretivePayloadAddrs) { throw new Error(`(UNEXPECTED) conflict.accretivePayloadAddrs already truthy? This is expected to be falsy at this point in the sync. (E: 6b6b1846779867849cbde208f4374326)`); }
|
|
1751
|
+
conflict.accretivePayloadAddrs = accretivePayloadAddrs;
|
|
1752
|
+
activeConflicts.push(conflict);
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
if (activeConflicts.length > 0) {
|
|
1757
|
+
proposeCommit = false;
|
|
1758
|
+
} else {
|
|
1759
|
+
proposeCommit = true;
|
|
1744
1760
|
}
|
|
1745
1761
|
|
|
1746
|
-
if (logalot) { console.log(`${lc} [CONFLICT DEBUG] Finished processing ${conflicts.length} conflicts. outgoingPayloadIbGibsDomain_conflicts.length (total outgoing payload ibgibs for ALL conflicts): ${outgoingPayloadIbGibsDomain_conflicts.length}`); }
|
|
1762
|
+
if (logalot) { console.log(`${lc} [CONFLICT DEBUG] Finished processing ${conflicts.length} conflicts. Active (divergent) conflicts: ${activeConflicts.length}. outgoingPayloadIbGibsDomain_conflicts.length (total outgoing payload ibgibs for ALL conflicts): ${outgoingPayloadIbGibsDomain_conflicts.length}`); }
|
|
1747
1763
|
} else {
|
|
1748
1764
|
if (logalot) { console.log(`${lc} [CONFLICT DEBUG] No optimistic conflicts to process`); }
|
|
1749
1765
|
}
|
|
@@ -1783,7 +1799,7 @@ export class SyncSagaCoordinator {
|
|
|
1783
1799
|
/**
|
|
1784
1800
|
* these are the modified conflicts with additional information.
|
|
1785
1801
|
*/
|
|
1786
|
-
conflicts,
|
|
1802
|
+
conflicts: activeConflicts,
|
|
1787
1803
|
/**
|
|
1788
1804
|
* we're sending these domain ibgibs as payload (they were
|
|
1789
1805
|
* requested by receiver and/or they are being sent as delta
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
|
-
respecfully, ifWeMight, iReckon,
|
|
12
|
+
respecfully, ifWeMight, iReckon, ifWe,
|
|
13
13
|
} from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
|
|
14
14
|
const maam = `[${import.meta.url}]`, sir = maam;
|
|
15
15
|
import { clone, delay, extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
@@ -154,12 +154,12 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
|
|
|
154
154
|
syncError = error;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
await
|
|
157
|
+
await ifWe(sir, 'completes the entire sync saga successfully', async () => {
|
|
158
158
|
const errorMsg = syncError ? extractErrorMsg(syncError) : '';
|
|
159
159
|
iReckon(sir, syncError).asTo(`syncError: ${errorMsg}`).isGonnaBeFalsy();
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
await
|
|
162
|
+
await ifWe(sir, 'alpha dep graph matches on source and dest', async () => {
|
|
163
163
|
const resGetDest = await getFromSpace({ space: destSpace, addr: xStoneAddr });
|
|
164
164
|
iReckon(sir, resGetDest.success && resGetDest.ibGibs?.length === 1).asTo('xStone exists in destSpace').isGonnaBeTrue();
|
|
165
165
|
if (resGetDest.success && resGetDest.ibGibs?.[0]) {
|
|
@@ -171,7 +171,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
|
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
-
await
|
|
174
|
+
await ifWe(sir, 'sessionIdentity evolved the expected number of times', async () => {
|
|
175
175
|
const latestS = peer.currentSessionIdentity;
|
|
176
176
|
iReckon(sir, latestS).asTo('latest session identity exists on peer').isGonnaBeTruthy();
|
|
177
177
|
if (latestS) {
|
|
@@ -179,7 +179,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
|
|
182
|
-
await
|
|
182
|
+
await ifWe(sir, 'sender durable space has I (evolved frame)', async () => {
|
|
183
183
|
const latestSenderIdentityAddr = await metaspace.getLatestAddr({
|
|
184
184
|
addr: getIbGibAddr({ ibGib: senderIdentity }),
|
|
185
185
|
space: sourceSpace,
|
|
@@ -195,7 +195,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
|
|
|
195
195
|
}
|
|
196
196
|
});
|
|
197
197
|
|
|
198
|
-
await
|
|
198
|
+
await ifWe(sir, 'receiver durable space has I (evolved frame)', async () => {
|
|
199
199
|
const latestSenderIdentityAddr = await metaspace.getLatestAddr({
|
|
200
200
|
addr: getIbGibAddr({ ibGib: senderIdentity }),
|
|
201
201
|
space: sourceSpace,
|
|
@@ -211,7 +211,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
|
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
213
|
|
|
214
|
-
await
|
|
214
|
+
await ifWe(sir, 'sender durable space has full S dep graph', async () => {
|
|
215
215
|
const latestS = peer.currentSessionIdentity;
|
|
216
216
|
iReckon(sir, latestS).asTo('latestS exists').isGonnaBeTruthy();
|
|
217
217
|
if (latestS) {
|
|
@@ -221,7 +221,7 @@ await respecfully(sir, `Test Phase 3A: Ping Pong Sync with Identity`, async () =
|
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
223
|
|
|
224
|
-
await
|
|
224
|
+
await ifWe(sir, 'receiver durable space has full S dep graph', async () => {
|
|
225
225
|
const latestS = peer.currentSessionIdentity;
|
|
226
226
|
iReckon(sir, latestS).asTo('latestS exists').isGonnaBeTruthy();
|
|
227
227
|
if (latestS) {
|
|
@@ -293,11 +293,7 @@ export async function appendToTimeline({
|
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
|
|
297
|
-
// should we await the publish or spin it off
|
|
298
|
-
// right now I have this spin off, inside the lock
|
|
299
|
-
// await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space });
|
|
300
|
-
metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space }); // spin off
|
|
296
|
+
await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space }); // already spins off
|
|
301
297
|
|
|
302
298
|
return newTimelineIbGib;
|
|
303
299
|
};
|
|
@@ -314,12 +310,6 @@ export async function appendToTimeline({
|
|
|
314
310
|
fn,
|
|
315
311
|
});
|
|
316
312
|
|
|
317
|
-
// should we publish within the lock or not within the lock?
|
|
318
|
-
// should we await the publish or spin it off
|
|
319
|
-
// right now I have this spin off, inside the lock
|
|
320
|
-
// await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space });
|
|
321
|
-
// metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space }); // spin off
|
|
322
|
-
|
|
323
313
|
return newTimelineIbGib;
|
|
324
314
|
} catch (error) {
|
|
325
315
|
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
@@ -691,10 +681,6 @@ export async function mut8Timeline<TData extends IbGibData_V1 = any>({
|
|
|
691
681
|
});
|
|
692
682
|
}
|
|
693
683
|
|
|
694
|
-
// should we publish within the lock or not within the lock?
|
|
695
|
-
// should we await the publish or spin it off
|
|
696
|
-
// right now I have this spin off, inside the lock
|
|
697
|
-
// await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space });
|
|
698
684
|
// we await the register call because this spins off the publish events (we are assuming implementation details here)
|
|
699
685
|
await metaspace.registerNewIbGib({ ibGib: newTimelineIbGib, space }); // already spins off
|
|
700
686
|
|
|
@@ -186,14 +186,14 @@ respecfully(sir, `[timeline-api]`, async () => {
|
|
|
186
186
|
* I'm getting output (warnings?) that the transform ibgib addr
|
|
187
187
|
* already exists. This stems from the fact that dna/transform
|
|
188
188
|
* ibgibs do not have timestamps or anything, they simply are
|
|
189
|
-
* memoized args to the transform functions. So we need something
|
|
189
|
+
* memoized args to the transform functions. So we need something
|
|
190
190
|
* unique _in the arg itself_, which in this case means in the
|
|
191
191
|
* `dataToAddOrPatch` field.
|
|
192
|
-
*
|
|
192
|
+
*
|
|
193
193
|
* Note, however, that it is expected for the original `fork`
|
|
194
194
|
* transform that created tInitial to be common and for it to
|
|
195
195
|
* already have this fork dna ibgib. But this shouldn't happen for
|
|
196
|
-
* each mut8 transform.
|
|
196
|
+
* each mut8 transform.
|
|
197
197
|
*/
|
|
198
198
|
const uniqueIdsForUniqueTransforms: string[] = [];
|
|
199
199
|
for (let i = 0; i < N; i++) {
|
|
@@ -689,52 +689,6 @@ export abstract class ReconciliationSpaceBase<
|
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
|
|
692
|
-
// protected async applyTransforms({
|
|
693
|
-
// src,
|
|
694
|
-
// createdIbGibs_Running,
|
|
695
|
-
// dnaAddrsToApplyToStoreVersion,
|
|
696
|
-
// allLocalIbGibs,
|
|
697
|
-
// }: {
|
|
698
|
-
// src: TIbGib,
|
|
699
|
-
// createdIbGibs_Running: TIbGib[],
|
|
700
|
-
// dnaAddrsToApplyToStoreVersion: IbGibAddr[],
|
|
701
|
-
// allLocalIbGibs: TIbGib[],
|
|
702
|
-
// }): Promise<TIbGib> {
|
|
703
|
-
// const lc = `${this.lc}[${this.applyTransforms.name}]`;
|
|
704
|
-
// try {
|
|
705
|
-
// if (logalot) { console.log(`${lc} starting...`); }
|
|
706
|
-
|
|
707
|
-
// let currentSrc = src;
|
|
708
|
-
// // find the dna ibgibs from the local ibgibs that were passed in.
|
|
709
|
-
// const allLocalIbGibsMap = new Map<IbGibAddr, TIbGib>();
|
|
710
|
-
// allLocalIbGibs.forEach(x => allLocalIbGibsMap.set(getIbGibAddr({ ibGib: x }), x));
|
|
711
|
-
|
|
712
|
-
// for (const dnaAddr of dnaAddrsToApplyToStoreVersion) {
|
|
713
|
-
// const dnaIbGib = allLocalIbGibsMap.get(dnaAddr);
|
|
714
|
-
// if (!dnaIbGib) { throw new Error(`(UNEXPECTED) dnaIbGib not found in allLocalIbGibs. addr: ${dnaAddr} (E: 106402377a644e5989710f606e9323ff)`); }
|
|
715
|
-
// const resMut8 = await mut8({
|
|
716
|
-
// src: currentSrc,
|
|
717
|
-
// mut8Ib: dnaIbGib.ib,
|
|
718
|
-
// dataToAddOrPatch: { ...dnaIbGib.data }, // this is a transform, so we just care about data and ib
|
|
719
|
-
// noTimestamp: true,
|
|
720
|
-
// });
|
|
721
|
-
|
|
722
|
-
// currentSrc = resMut8.newIbGib as TIbGib;
|
|
723
|
-
// if (resMut8.intermediateIbGibs) {
|
|
724
|
-
// resMut8.intermediateIbGibs.forEach(x => createdIbGibs_Running.push(x as TIbGib));
|
|
725
|
-
// }
|
|
726
|
-
// createdIbGibs_Running.push(currentSrc);
|
|
727
|
-
// }
|
|
728
|
-
|
|
729
|
-
// return currentSrc;
|
|
730
|
-
// } catch (error) {
|
|
731
|
-
// const emsg = `${lc} ${extractErrorMsg(error)}`;
|
|
732
|
-
// console.error(emsg);
|
|
733
|
-
// throw error;
|
|
734
|
-
// }
|
|
735
|
-
// }
|
|
736
|
-
|
|
737
|
-
|
|
738
692
|
protected async routeAndDoCommand<TCmdModifier extends SyncSpaceOptionsCmdModifier = SyncSpaceOptionsCmdModifier>({
|
|
739
693
|
cmd,
|
|
740
694
|
cmdModifiers,
|
|
@@ -135,13 +135,14 @@ export async function applyTransforms({
|
|
|
135
135
|
const dnaIbGib_IntermediateArray =
|
|
136
136
|
allLocalIbGibs.filter(x => getIbGibAddr({ ibGib: x }) === dnaAddrToApply);
|
|
137
137
|
let dnaIbGib: IbGib_V1;
|
|
138
|
-
if (dnaIbGib_IntermediateArray.length
|
|
138
|
+
if (dnaIbGib_IntermediateArray.length > 0) {
|
|
139
139
|
dnaIbGib = dnaIbGib_IntermediateArray[0];
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
// NOTE: length > 1 is NOT an error condition because mut8/rel8
|
|
141
|
+
// transforms do not have uuids or timestamps. So if the same
|
|
142
|
+
// mut8/rel8 call occurs, e.g., changing the same field on the
|
|
143
|
+
// same source, then we could have a duplicate dna transform.
|
|
142
144
|
} else {
|
|
143
|
-
|
|
144
|
-
throw new Error(`More than one ibGib in allLocalIbGibs with the dna address of ${dnaAddrToApply}? (E: a726134f4cc14a4fb2ed2d39d22af17c)(UNEXPECTED)`);
|
|
145
|
+
throw new Error(`dna ibGib not found in supplied allLocalIbGibs. dnaAddr: ${dnaAddrToApply}. (E: 7f56826852cf48a79ab8af16bf27e284)`);
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
// we have our dna to apply, so do so against the incoming src
|
package/tsconfig.json
CHANGED
|
@@ -9,9 +9,14 @@
|
|
|
9
9
|
"outDir": "./dist", /* Redirect output structure to the directory. */
|
|
10
10
|
"module": "ESNext", /* https://www.typescriptlang.org/docs/handbook/esm-node.html */
|
|
11
11
|
},
|
|
12
|
+
"include": [
|
|
13
|
+
"src/**/*.ts",
|
|
14
|
+
"src/**/*.mts",
|
|
15
|
+
"src/keystone/policy/profiles/*.json"
|
|
16
|
+
],
|
|
12
17
|
"exclude": [
|
|
13
18
|
"./node_modules",
|
|
14
19
|
"**/*.spec.mts",
|
|
15
20
|
"./dist/**/*"
|
|
16
21
|
]
|
|
17
|
-
}
|
|
22
|
+
}
|