@serfab/cadre-core 1.19.1 → 1.20.0
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/cadre-node.d.ts +53 -14
- package/dist/cadre-node.js +97 -30
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-database.d.ts +2 -1
- package/dist/control-database.js +128 -126
- package/dist/control-database.js.map +1 -1
- package/dist/control-protocol-guard.js +3 -2
- package/dist/control-protocol-guard.js.map +1 -1
- package/dist/control-stream.js +2 -1
- package/dist/control-stream.js.map +1 -1
- package/dist/describe-thrown.d.ts +12 -0
- package/dist/describe-thrown.js +59 -0
- package/dist/describe-thrown.js.map +1 -0
- package/dist/edge-node/dissolve.d.ts +1 -1
- package/dist/edge-node/dissolve.js +1 -1
- package/dist/edge-node/dissolve.js.map +1 -1
- package/dist/edge-node/edge-join.js +2 -1
- package/dist/edge-node/edge-join.js.map +1 -1
- package/dist/edge-node/edge-node.js +2 -1
- package/dist/edge-node/edge-node.js.map +1 -1
- package/dist/edge-node/strand-move.d.ts +0 -2
- package/dist/edge-node/strand-move.js +1 -4
- package/dist/edge-node/strand-move.js.map +1 -1
- package/dist/edge-node/strands.js +2 -1
- package/dist/edge-node/strands.js.map +1 -1
- package/dist/enrollment.js +2 -1
- package/dist/enrollment.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/member-redemption.js +3 -9
- package/dist/member-redemption.js.map +1 -1
- package/dist/node-local-snapshot.js +2 -1
- package/dist/node-local-snapshot.js.map +1 -1
- package/dist/peer-dial.js +3 -2
- package/dist/peer-dial.js.map +1 -1
- package/dist/pending-join-runner.d.ts +29 -2
- package/dist/pending-join-runner.js +60 -20
- package/dist/pending-join-runner.js.map +1 -1
- package/dist/push-notifier-apns.js +8 -7
- package/dist/push-notifier-apns.js.map +1 -1
- package/dist/push-notifier-fcm.js +6 -5
- package/dist/push-notifier-fcm.js.map +1 -1
- package/dist/push-notifier-shared.d.ts +0 -2
- package/dist/push-notifier-shared.js +4 -4
- package/dist/push-notifier-shared.js.map +1 -1
- package/dist/relay-reservation.js +4 -3
- package/dist/relay-reservation.js.map +1 -1
- package/dist/strand-addr-protocol.js +2 -1
- package/dist/strand-addr-protocol.js.map +1 -1
- package/dist/strand-app-schema-report.d.ts +53 -0
- package/dist/strand-app-schema-report.js +77 -0
- package/dist/strand-app-schema-report.js.map +1 -0
- package/dist/strand-database.d.ts +9 -5
- package/dist/strand-database.js +12 -6
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-first-sync-gate.js +4 -3
- package/dist/strand-first-sync-gate.js.map +1 -1
- package/dist/strand-formation-protocol.js +4 -3
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +8 -2
- package/dist/strand-instance-manager.js +8 -6
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-membership-reconciler.js +9 -11
- package/dist/strand-membership-reconciler.js.map +1 -1
- package/dist/strand-move.js +4 -6
- package/dist/strand-move.js.map +1 -1
- package/dist/strand-offline.d.ts +10 -39
- package/dist/strand-offline.js +9 -54
- package/dist/strand-offline.js.map +1 -1
- package/dist/types.d.ts +7 -5
- package/dist/types.js.map +1 -1
- package/package.json +8 -8
- package/src/cadre-node.ts +11528 -11456
- package/src/control-database.ts +5594 -5592
- package/src/control-protocol-guard.ts +3 -2
- package/src/control-stream.ts +2 -1
- package/src/describe-thrown.ts +60 -0
- package/src/edge-node/dissolve.ts +2 -1
- package/src/edge-node/edge-join.ts +1 -1
- package/src/edge-node/edge-node.ts +2 -1
- package/src/edge-node/strand-move.ts +1 -5
- package/src/edge-node/strands.ts +74 -73
- package/src/enrollment.ts +2 -1
- package/src/index.ts +924 -917
- package/src/member-redemption.ts +3 -9
- package/src/node-local-snapshot.ts +2 -1
- package/src/peer-dial.ts +605 -604
- package/src/pending-join-runner.ts +68 -22
- package/src/push-notifier-apns.ts +8 -7
- package/src/push-notifier-fcm.ts +6 -5
- package/src/push-notifier-shared.ts +5 -5
- package/src/relay-reservation.ts +1212 -1211
- package/src/strand-addr-protocol.ts +2 -1
- package/src/strand-app-schema-report.ts +115 -0
- package/src/strand-database.ts +474 -466
- package/src/strand-first-sync-gate.ts +600 -599
- package/src/strand-formation-protocol.ts +4 -3
- package/src/strand-instance-manager.ts +2219 -2210
- package/src/strand-membership-reconciler.ts +942 -945
- package/src/strand-move.ts +594 -597
- package/src/strand-offline.ts +11 -80
- package/src/types.ts +2962 -2960
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
type FormationRejectionCode
|
|
43
43
|
} from './strand-formation-rejection.js';
|
|
44
44
|
import type { FormationTokenCheck, FormationTokenRead } from './formation-token.js';
|
|
45
|
+
import { describeThrown, toError } from './describe-thrown.js';
|
|
45
46
|
|
|
46
47
|
const log = debug('sereus:cadre:formation-proto');
|
|
47
48
|
|
|
@@ -918,7 +919,7 @@ async function releaseFormationConnection(connection: Connection): Promise<void>
|
|
|
918
919
|
await connection.close();
|
|
919
920
|
} catch (error) {
|
|
920
921
|
log('closing the formation connection to %s failed; aborting it: %o', connection.remotePeer.toString(), error);
|
|
921
|
-
connection.abort(
|
|
922
|
+
connection.abort(toError(error));
|
|
922
923
|
}
|
|
923
924
|
}
|
|
924
925
|
|
|
@@ -1011,7 +1012,7 @@ function noMachineReached(failures: Array<{ peerId: string; error: FormationUnre
|
|
|
1011
1012
|
*/
|
|
1012
1013
|
function describeAllAddressesFailed(error: unknown): unknown {
|
|
1013
1014
|
if (!(error instanceof AggregateError)) return error;
|
|
1014
|
-
const reasons = error.errors.map(
|
|
1015
|
+
const reasons = error.errors.map(describeThrown);
|
|
1015
1016
|
return new FormationUnreachableError(
|
|
1016
1017
|
`Formation could not reach the inviter at any of the ${reasons.length} addresses tried: ${reasons.join('; ')}`,
|
|
1017
1018
|
{ cause: error }
|
|
@@ -1021,7 +1022,7 @@ function describeAllAddressesFailed(error: unknown): unknown {
|
|
|
1021
1022
|
/** Report a failure that came before any answer as {@link FormationUnreachableError}, keeping its message. */
|
|
1022
1023
|
function asUnreachable(error: unknown): FormationUnreachableError {
|
|
1023
1024
|
if (error instanceof FormationUnreachableError) return error;
|
|
1024
|
-
return new FormationUnreachableError(
|
|
1025
|
+
return new FormationUnreachableError(describeThrown(error), { cause: error });
|
|
1025
1026
|
}
|
|
1026
1027
|
|
|
1027
1028
|
/**
|