@indigoai-us/hq-cloud 6.18.16-alpha.0 → 6.18.16-alpha.1
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/bin/sync-runner-watch-loop.d.ts +3 -0
- package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
- package/dist/bin/sync-runner-watch-loop.js +92 -7
- package/dist/bin/sync-runner-watch-loop.js.map +1 -1
- package/dist/bin/sync-runner-watch-loop.test.js +12 -1
- package/dist/bin/sync-runner-watch-loop.test.js.map +1 -1
- package/dist/bin/sync-runner.test.js +55 -0
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/cli/sync.d.ts +1 -17
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +4 -56
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/sync.test.js +0 -144
- package/dist/cli/sync.test.js.map +1 -1
- package/dist/sync/event-sync.d.ts +2 -0
- package/dist/sync/event-sync.d.ts.map +1 -1
- package/dist/sync/event-sync.js +15 -1
- package/dist/sync/event-sync.js.map +1 -1
- package/dist/sync/event-sync.test.js +32 -0
- package/dist/sync/event-sync.test.js.map +1 -1
- package/dist/sync/push-receiver.d.ts +21 -1
- package/dist/sync/push-receiver.d.ts.map +1 -1
- package/dist/sync/push-receiver.js +166 -8
- package/dist/sync/push-receiver.js.map +1 -1
- package/dist/sync/push-receiver.test.js +258 -1
- package/dist/sync/push-receiver.test.js.map +1 -1
- package/dist/sync/receiver-last-delivery.d.ts +22 -0
- package/dist/sync/receiver-last-delivery.d.ts.map +1 -0
- package/dist/sync/receiver-last-delivery.js +139 -0
- package/dist/sync/receiver-last-delivery.js.map +1 -0
- package/dist/sync/receiver-last-delivery.test.d.ts +2 -0
- package/dist/sync/receiver-last-delivery.test.d.ts.map +1 -0
- package/dist/sync/receiver-last-delivery.test.js +110 -0
- package/dist/sync/receiver-last-delivery.test.js.map +1 -0
- package/dist/sync/sync-contract.d.ts.map +1 -1
- package/dist/sync/sync-contract.js +1 -0
- package/dist/sync/sync-contract.js.map +1 -1
- package/dist/sync-contract.json +2 -1
- package/dist/watch-owner-lease.d.ts +2 -0
- package/dist/watch-owner-lease.d.ts.map +1 -1
- package/dist/watch-owner-lease.js +3 -2
- package/dist/watch-owner-lease.js.map +1 -1
- package/dist/watch-owner-lease.test.js +22 -4
- package/dist/watch-owner-lease.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli/case-alias.d.ts +0 -37
- package/dist/cli/case-alias.d.ts.map +0 -1
- package/dist/cli/case-alias.js +0 -140
- package/dist/cli/case-alias.js.map +0 -1
- package/dist/cli/case-alias.test.d.ts +0 -2
- package/dist/cli/case-alias.test.d.ts.map +0 -1
- package/dist/cli/case-alias.test.js +0 -96
- package/dist/cli/case-alias.test.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type TreeChange, type TreeChangeBatch } from "../watcher.js";
|
|
2
2
|
import { readJournal } from "../journal.js";
|
|
3
|
+
import { ReceiverDispatchError } from "../sync/push-receiver.js";
|
|
3
4
|
import { type FeatureSwitch } from "../sync/feature-flags.js";
|
|
4
5
|
import { HeapCensus } from "./sync-runner-heap-telemetry.js";
|
|
5
6
|
import { FullPassCapController } from "../sync/full-pass-caps.js";
|
|
@@ -7,6 +8,7 @@ import { type RealtimeTelemetryReason } from "../sync/realtime-telemetry.js";
|
|
|
7
8
|
import { type PathWorkOutcome } from "../sync/sync-work.js";
|
|
8
9
|
import type { TelemetryClaims } from "../telemetry-events.js";
|
|
9
10
|
import type { JournalEntry } from "../types.js";
|
|
11
|
+
import { type WatchRoute } from "./sync-runner-watch-routes.js";
|
|
10
12
|
import type { CooperativePassCheckpoint, Direction, RunnerLoopDeps, RunnerPassOutcome } from "./sync-runner.js";
|
|
11
13
|
/** Maximum time shutdown waits for event-sync startup before abandoning it. */
|
|
12
14
|
export declare const EVENT_SYNC_STARTUP_SHUTDOWN_WAIT_MS = 5000;
|
|
@@ -388,6 +390,7 @@ export declare function publishedContentHashFromJournalEntry(entry: Readonly<Jou
|
|
|
388
390
|
*/
|
|
389
391
|
export declare function shouldQuarantineWatcherDeleteIntents(expandedEntries: number, journalEntries: number): boolean;
|
|
390
392
|
export declare function shouldAcknowledgeParallelUnresolvedCompany(accepted: boolean, exitCode: number): boolean;
|
|
393
|
+
export declare function targetedReceiverDispatchError(outcome: number | RunnerPassOutcome, accepted: boolean, authRequiredExitCode: number, route: WatchRoute): ReceiverDispatchError;
|
|
391
394
|
export declare function runOneShotWithOperationLock(argv: string[], parsed: ParsedLoopArgs, deps: RunnerLoopDeps, runtime: WatchLoopRuntime): Promise<number>;
|
|
392
395
|
export declare function runWatchLoop(argv: string[], parsed: ParsedLoopArgs, deps: RunnerLoopDeps, runtime: WatchLoopRuntime): Promise<number>;
|
|
393
396
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-runner-watch-loop.d.ts","sourceRoot":"","sources":["../../src/bin/sync-runner-watch-loop.ts"],"names":[],"mappings":"AAwBA,OAAO,EAML,KAAK,UAAU,EAEf,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAUL,WAAW,EASZ,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-runner-watch-loop.d.ts","sourceRoot":"","sources":["../../src/bin/sync-runner-watch-loop.ts"],"names":[],"mappings":"AAwBA,OAAO,EAML,KAAK,UAAU,EAEf,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAUL,WAAW,EASZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAEL,qBAAqB,EAItB,MAAM,0BAA0B,CAAC;AAclC,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AASlC,OAAO,EACL,UAAU,EA0CX,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EAEL,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAGL,KAAK,uBAAu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AAO,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAET;AAmBD,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,MAAM,GAAG,iBAAiB,EACnC,QAAQ,EAAE,OAAO,EACjB,oBAAoB,EAAE,MAAM,EAC5B,KAAK,EAAE,UAAU,GAChB,qBAAqB,CAwBvB;AAmCD,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,CA2xHjB"}
|
|
@@ -18,6 +18,7 @@ import { recoverHqRootLocalState } from "../hq-root-recovery.js";
|
|
|
18
18
|
import { clearLocalDeleteIntent, getStateDir, markLocalDeleteIntent, PERSONAL_VAULT_JOURNAL_SLUG, openJournalStoreSession, openJournalStoreSessionAsync, listJournalSlugs, listJournals, maintainAreaJournalSlice, disposeScopedJournalStores, releaseScopedJournalStore, releaseCachedAreaJournalMigrations, journalCacheCensusSizes, emitJournalCacheMetric, journalRows, readJournalScoped, writeJournal, } from "../journal.js";
|
|
19
19
|
import { isPersonalVaultDeletionExcluded } from "../personal-vault.js";
|
|
20
20
|
import { NoopPushReceiver, ReceiverDispatchError, isReceiverTransportFailure, } from "../sync/push-receiver.js";
|
|
21
|
+
import { appendReceiverLastDeliveryEntry, clearReceiverLastDeliveryEntries, readReceiverLastDeliveryEntries, receiverLastDeliveryFilePath, } from "../sync/receiver-last-delivery.js";
|
|
21
22
|
import { CONTENT_HASH_PATTERN } from "../sync/push-event.js";
|
|
22
23
|
import { resolveEventSync, startEventSync as defaultStartEventSync, } from "../sync/event-sync.js";
|
|
23
24
|
import { resolveAreaStorageEnabled, resolveEffectiveParallelSyncRollout, resolveParallelSyncRollout, } from "../sync/feature-flags.js";
|
|
@@ -1330,7 +1331,7 @@ function unresolvedReceiverMessagesWereRedelivered(events, receiveCountsByPath)
|
|
|
1330
1331
|
receiveCounts.every((count) => count !== undefined && Number.isFinite(count) && count >= 2);
|
|
1331
1332
|
});
|
|
1332
1333
|
}
|
|
1333
|
-
function targetedReceiverDispatchError(outcome, accepted, authRequiredExitCode) {
|
|
1334
|
+
export function targetedReceiverDispatchError(outcome, accepted, authRequiredExitCode, route) {
|
|
1334
1335
|
const exitCode = passExitCode(outcome);
|
|
1335
1336
|
const result = typeof outcome === "number" ? undefined : outcome.result;
|
|
1336
1337
|
const diagnostics = [
|
|
@@ -1340,11 +1341,12 @@ function targetedReceiverDispatchError(outcome, accepted, authRequiredExitCode)
|
|
|
1340
1341
|
];
|
|
1341
1342
|
const failureReason = `targeted pull failed with exit code ${exitCode}, accepted=${accepted}` +
|
|
1342
1343
|
(diagnostics.length === 0 ? "" : `: ${[...new Set(diagnostics)].join("; ")}`);
|
|
1343
|
-
const isTransportFailure =
|
|
1344
|
+
const isTransportFailure = !accepted ||
|
|
1345
|
+
exitCode === authRequiredExitCode ||
|
|
1344
1346
|
exitCode === TRANSIENT_NETWORK_EXIT ||
|
|
1345
1347
|
(result?.transient?.length ?? 0) > 0 ||
|
|
1346
1348
|
isReceiverTransportFailure(failureReason);
|
|
1347
|
-
return new ReceiverDispatchError(isTransportFailure ? "transport" : "path-specific", failureReason);
|
|
1349
|
+
return new ReceiverDispatchError(isTransportFailure ? "transport" : "path-specific", failureReason, routeKey(route), exitCode, accepted);
|
|
1348
1350
|
}
|
|
1349
1351
|
/**
|
|
1350
1352
|
* Exit code for one scoped/catch-up route. A 404 company route returns
|
|
@@ -3318,6 +3320,80 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3318
3320
|
}
|
|
3319
3321
|
return worstExit;
|
|
3320
3322
|
};
|
|
3323
|
+
const receiverRecoveryRoutesPending = new Set();
|
|
3324
|
+
let receiverRecoveryReadWarningEmitted = false;
|
|
3325
|
+
const runReceiverLastDeliveryDrain = () => {
|
|
3326
|
+
let snapshot;
|
|
3327
|
+
try {
|
|
3328
|
+
snapshot = readReceiverLastDeliveryEntries(receiverLastDeliveryFilePath(getStateDir()));
|
|
3329
|
+
}
|
|
3330
|
+
catch {
|
|
3331
|
+
if (!receiverRecoveryReadWarningEmitted) {
|
|
3332
|
+
receiverRecoveryReadWarningEmitted = true;
|
|
3333
|
+
process.stderr.write("hq-sync-runner: receiver last-delivery recovery state unreadable; entries retained\n");
|
|
3334
|
+
}
|
|
3335
|
+
return;
|
|
3336
|
+
}
|
|
3337
|
+
if (snapshot.length === 0)
|
|
3338
|
+
return;
|
|
3339
|
+
const routes = new Map();
|
|
3340
|
+
const skipCompanies = resolveSkipCompanies();
|
|
3341
|
+
for (const entry of snapshot) {
|
|
3342
|
+
const route = routeChangeToTarget(entry.relativePath);
|
|
3343
|
+
if (route === null ||
|
|
3344
|
+
routeKey(route) !== entry.route ||
|
|
3345
|
+
!isWatchRouteSelected(route, watchRouteSelection) ||
|
|
3346
|
+
(route.kind === "company" && skipCompanies.has(route.slug.toLowerCase()))) {
|
|
3347
|
+
continue;
|
|
3348
|
+
}
|
|
3349
|
+
const key = routeKey(route);
|
|
3350
|
+
const group = routes.get(key) ?? { route, entries: [] };
|
|
3351
|
+
group.entries.push(entry);
|
|
3352
|
+
routes.set(key, group);
|
|
3353
|
+
}
|
|
3354
|
+
const clearCompletedEntries = (route, entries) => {
|
|
3355
|
+
const cleared = clearReceiverLastDeliveryEntries(receiverLastDeliveryFilePath(getStateDir()), entries);
|
|
3356
|
+
if (!cleared.ok) {
|
|
3357
|
+
process.stderr.write(`hq-sync-runner: receiver recovery state for ${routeKey(route)} could not be cleared; entries retained\n`);
|
|
3358
|
+
}
|
|
3359
|
+
};
|
|
3360
|
+
if (parallelCoordinatorEnabled) {
|
|
3361
|
+
for (const [key, { route, entries }] of routes) {
|
|
3362
|
+
if (receiverRecoveryRoutesPending.has(key))
|
|
3363
|
+
continue;
|
|
3364
|
+
receiverRecoveryRoutesPending.add(key);
|
|
3365
|
+
enqueueChore("backlog", () => runGuarded(buildRoutePullArgv(route, passArgv)), (execution) => {
|
|
3366
|
+
receiverRecoveryRoutesPending.delete(key);
|
|
3367
|
+
const exit = execution.accepted ? passExitCode(execution.result) : 1;
|
|
3368
|
+
if (exit === 0) {
|
|
3369
|
+
clearCompletedEntries(route, entries);
|
|
3370
|
+
return;
|
|
3371
|
+
}
|
|
3372
|
+
process.stderr.write(`hq-sync-runner: receiver recovery route ${key} failed (exit=${exit}); entry retained\n`);
|
|
3373
|
+
interruptWait();
|
|
3374
|
+
});
|
|
3375
|
+
}
|
|
3376
|
+
return;
|
|
3377
|
+
}
|
|
3378
|
+
if (routes.size === 0)
|
|
3379
|
+
return;
|
|
3380
|
+
return (async () => {
|
|
3381
|
+
for (const [key, { route, entries }] of routes) {
|
|
3382
|
+
try {
|
|
3383
|
+
const result = await runGuarded(buildRoutePullArgv(route, passArgv));
|
|
3384
|
+
const exit = passExitCode(result);
|
|
3385
|
+
if (exit === 0) {
|
|
3386
|
+
clearCompletedEntries(route, entries);
|
|
3387
|
+
continue;
|
|
3388
|
+
}
|
|
3389
|
+
process.stderr.write(`hq-sync-runner: receiver recovery route ${key} failed (exit=${exit}); entry retained\n`);
|
|
3390
|
+
}
|
|
3391
|
+
catch (error) {
|
|
3392
|
+
process.stderr.write(`hq-sync-runner: receiver recovery route ${key} failed (${describeError(error)}); entry retained\n`);
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
})();
|
|
3396
|
+
};
|
|
3321
3397
|
let receiver = null;
|
|
3322
3398
|
let receiverHasQueuedWork = false;
|
|
3323
3399
|
const warnUnresolvedReceiverCompany = (route, pathCount) => {
|
|
@@ -3607,13 +3683,13 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3607
3683
|
const exitCode = passExitCode(execution.result);
|
|
3608
3684
|
if (shouldAcknowledgeParallelUnresolvedCompany(execution.accepted, exitCode)) {
|
|
3609
3685
|
if (!unresolvedReceiverMessagesWereRedelivered(events, receiveCountsByPath)) {
|
|
3610
|
-
throw targetedReceiverDispatchError(execution.result, execution.accepted, runtime.authRequiredPassExit);
|
|
3686
|
+
throw targetedReceiverDispatchError(execution.result, execution.accepted, runtime.authRequiredPassExit, route);
|
|
3611
3687
|
}
|
|
3612
3688
|
warnUnresolvedReceiverCompany(route, pathCount);
|
|
3613
3689
|
continue;
|
|
3614
3690
|
}
|
|
3615
3691
|
if (!execution.accepted || exitCode !== 0) {
|
|
3616
|
-
throw targetedReceiverDispatchError(execution.result, execution.accepted, runtime.authRequiredPassExit);
|
|
3692
|
+
throw targetedReceiverDispatchError(execution.result, execution.accepted, runtime.authRequiredPassExit, route);
|
|
3617
3693
|
}
|
|
3618
3694
|
}
|
|
3619
3695
|
};
|
|
@@ -3670,13 +3746,13 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3670
3746
|
const exitCode = passExitCode(result);
|
|
3671
3747
|
if (exitCode === UNRESOLVED_COMPANY_EXIT) {
|
|
3672
3748
|
if (!unresolvedReceiverMessagesWereRedelivered(routeEvents, receiveCountsByPath)) {
|
|
3673
|
-
throw targetedReceiverDispatchError(result, true, runtime.authRequiredPassExit);
|
|
3749
|
+
throw targetedReceiverDispatchError(result, true, runtime.authRequiredPassExit, route);
|
|
3674
3750
|
}
|
|
3675
3751
|
warnUnresolvedReceiverCompany(route, routeEvents.length);
|
|
3676
3752
|
continue;
|
|
3677
3753
|
}
|
|
3678
3754
|
if (exitCode !== 0) {
|
|
3679
|
-
throw targetedReceiverDispatchError(result, true, runtime.authRequiredPassExit);
|
|
3755
|
+
throw targetedReceiverDispatchError(result, true, runtime.authRequiredPassExit, route);
|
|
3680
3756
|
}
|
|
3681
3757
|
}
|
|
3682
3758
|
};
|
|
@@ -3794,6 +3870,12 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
3794
3870
|
telemetryClaims: claims,
|
|
3795
3871
|
publishedContentHashStateDir: getStateDir(),
|
|
3796
3872
|
publishedContentHashLookup,
|
|
3873
|
+
recordLastDeliveryFailure: (entry) => {
|
|
3874
|
+
const stored = appendReceiverLastDeliveryEntry(receiverLastDeliveryFilePath(getStateDir()), entry);
|
|
3875
|
+
if (stored.ok)
|
|
3876
|
+
interruptWait();
|
|
3877
|
+
return stored.ok;
|
|
3878
|
+
},
|
|
3797
3879
|
onReceiveActivity,
|
|
3798
3880
|
});
|
|
3799
3881
|
if (!handles)
|
|
@@ -4331,6 +4413,9 @@ export async function runWatchLoop(argv, parsed, deps, runtime) {
|
|
|
4331
4413
|
// every bridge below.
|
|
4332
4414
|
releaseWatcherJournalStores();
|
|
4333
4415
|
const exitCode = passExitCode(result);
|
|
4416
|
+
const receiverRecoveryDrain = runReceiverLastDeliveryDrain();
|
|
4417
|
+
if (receiverRecoveryDrain)
|
|
4418
|
+
await receiverRecoveryDrain;
|
|
4334
4419
|
if (exitCode === runtime.authRequiredPassExit) {
|
|
4335
4420
|
// The pass already emitted auth-error. Hand the sentinel to the
|
|
4336
4421
|
// outer watch wrapper so it can park in-process (auth-wait) instead
|