@cadenza.io/service 2.17.50 → 2.17.51

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/dist/index.js CHANGED
@@ -8730,15 +8730,10 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8730
8730
  const executionFailedSignal = `meta.sync_controller.insert_execution_failed:${tableName}`;
8731
8731
  const pendingResolverContexts = /* @__PURE__ */ new Map();
8732
8732
  const prepareExecutionTask = CadenzaService.createMetaTask(
8733
- `Prepare graph sync insert execution for ${tableName}`,
8733
+ `Prepare graph sync insert for ${tableName}`,
8734
8734
  (ctx) => {
8735
- const originalContext = {
8736
- ...ctx
8737
- };
8738
- const originalQueryData = buildSyncInsertQueryData(
8739
- ctx,
8740
- queryData
8741
- );
8735
+ const originalContext = { ...ctx };
8736
+ const originalQueryData = buildSyncInsertQueryData(ctx, queryData);
8742
8737
  if (typeof ctx.__resolverRequestId === "string") {
8743
8738
  pendingResolverContexts.set(ctx.__resolverRequestId, {
8744
8739
  originalContext,
@@ -8790,7 +8785,7 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8790
8785
  );
8791
8786
  }
8792
8787
  const finalizeExecutionTask = CadenzaService.createMetaTask(
8793
- `Finalize graph sync insert execution for ${tableName}`,
8788
+ `Finalize graph sync insert for ${tableName}`,
8794
8789
  (ctx, emit) => {
8795
8790
  if (!ctx.__resolverRequestId) {
8796
8791
  return false;
@@ -8828,7 +8823,7 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8828
8823
  emit(executionResolvedSignal, normalizedContext);
8829
8824
  return normalizedContext;
8830
8825
  },
8831
- `Resolves signal-driven ${tableName} graph-sync insert execution.`,
8826
+ `Finalizes ${tableName} graph-sync insert execution after the authority task finishes.`,
8832
8827
  {
8833
8828
  register: false,
8834
8829
  isHidden: true
@@ -8841,11 +8836,14 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8841
8836
  `Log failed graph sync insert execution for ${tableName}`,
8842
8837
  (ctx) => {
8843
8838
  if (tableName === "task") {
8844
- if (shouldDebugTaskSyncPayload(ctx)) {
8839
+ if (shouldDebugTaskSyncPayload(ctx) || shouldDebugSyncTaskName(ctx.__taskName)) {
8845
8840
  logSyncDebug("insert_failed", {
8846
8841
  tableName,
8847
8842
  targetTaskName: targetTask.name,
8848
- payload: buildTaskSyncDebugPayload(ctx)
8843
+ payload: buildTaskSyncDebugPayload({
8844
+ ...ctx,
8845
+ __taskName: ctx.__taskName
8846
+ })
8849
8847
  });
8850
8848
  }
8851
8849
  } else {
@@ -8871,6 +8869,27 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8871
8869
  `Resolve graph sync insert for ${tableName}`,
8872
8870
  (ctx, emit) => new Promise((resolve) => {
8873
8871
  const resolverRequestId = (0, import_uuid6.v4)();
8872
+ const resolvedContext = {
8873
+ ...ctx,
8874
+ __resolverRequestId: resolverRequestId
8875
+ };
8876
+ if (debugTable) {
8877
+ if (tableName === "task") {
8878
+ if (shouldDebugTaskSyncPayload(resolvedContext)) {
8879
+ logSyncDebug("insert_resolver_request", {
8880
+ tableName,
8881
+ targetTaskName: targetTask.name,
8882
+ payload: buildTaskSyncDebugPayload(resolvedContext)
8883
+ });
8884
+ }
8885
+ } else {
8886
+ logSyncDebug("insert_resolver_request", {
8887
+ tableName,
8888
+ targetTaskName: targetTask.name,
8889
+ ctx: resolvedContext
8890
+ });
8891
+ }
8892
+ }
8874
8893
  CadenzaService.createEphemeralMetaTask(
8875
8894
  `Resolve graph sync insert execution for ${tableName} (${resolverRequestId})`,
8876
8895
  (resultCtx) => {
@@ -8885,15 +8904,12 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
8885
8904
  resolve(normalizedResult);
8886
8905
  return normalizedResult;
8887
8906
  },
8888
- `Waits for signal-driven ${tableName} graph-sync insert execution.`,
8907
+ `Waits for ${tableName} graph-sync insert execution.`,
8889
8908
  {
8890
8909
  register: false
8891
8910
  }
8892
8911
  ).doOn(executionResolvedSignal, executionFailedSignal);
8893
- emit(executionRequestedSignal, {
8894
- ...ctx,
8895
- __resolverRequestId: resolverRequestId
8896
- });
8912
+ emit(executionRequestedSignal, resolvedContext);
8897
8913
  }),
8898
8914
  `Routes graph sync inserts for ${tableName} through the local authority task when available.`,
8899
8915
  {