@dxos/client-services 0.5.9-main.df0042a → 0.5.9-main.e183eeb
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/lib/browser/{chunk-SLSPX47D.mjs → chunk-S5DPO2DT.mjs} +212 -189
- package/dist/lib/browser/chunk-S5DPO2DT.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-2K5VPBW6.cjs → chunk-F2EIFQZH.cjs} +308 -285
- package/dist/lib/node/chunk-F2EIFQZH.cjs.map +7 -0
- package/dist/lib/node/index.cjs +41 -41
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/packlets/testing/index.cjs +8 -8
- package/dist/types/src/packlets/identity/identity-service.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +36 -36
- package/src/packlets/identity/identity-service.ts +27 -6
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-SLSPX47D.mjs.map +0 -7
- package/dist/lib/node/chunk-2K5VPBW6.cjs.map +0 -7
|
@@ -355,7 +355,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
|
|
|
355
355
|
import { TRACE_PROCESSOR } from "@dxos/tracing";
|
|
356
356
|
|
|
357
357
|
// packages/sdk/client-services/src/version.ts
|
|
358
|
-
var DXOS_VERSION = "0.5.9-main.
|
|
358
|
+
var DXOS_VERSION = "0.5.9-main.e183eeb";
|
|
359
359
|
|
|
360
360
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
361
361
|
import { Platform } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -1519,13 +1519,17 @@ IdentityManager = _ts_decorate3([
|
|
|
1519
1519
|
], IdentityManager);
|
|
1520
1520
|
|
|
1521
1521
|
// packages/sdk/client-services/src/packlets/identity/identity-service.ts
|
|
1522
|
+
import { Trigger as Trigger3, sleep } from "@dxos/async";
|
|
1522
1523
|
import { Stream as Stream8 } from "@dxos/codec-protobuf";
|
|
1523
1524
|
import { Resource } from "@dxos/context";
|
|
1524
1525
|
import { signPresentation } from "@dxos/credentials";
|
|
1525
1526
|
import { todo } from "@dxos/debug";
|
|
1526
1527
|
import { invariant as invariant4 } from "@dxos/invariant";
|
|
1528
|
+
import { log as log6 } from "@dxos/log";
|
|
1527
1529
|
import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
1530
|
+
import { safeAwaitAll } from "@dxos/util";
|
|
1528
1531
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/identity/identity-service.ts";
|
|
1532
|
+
var DEFAULT_SPACE_SEARCH_TIMEOUT = 1e4;
|
|
1529
1533
|
var IdentityServiceImpl = class extends Resource {
|
|
1530
1534
|
constructor(_identityManager, _keyring, _dataSpaceManagerProvider, _createIdentity, _onProfileUpdate) {
|
|
1531
1535
|
super();
|
|
@@ -1555,7 +1559,7 @@ var IdentityServiceImpl = class extends Resource {
|
|
|
1555
1559
|
const identity = this._identityManager.identity;
|
|
1556
1560
|
invariant4(identity, void 0, {
|
|
1557
1561
|
F: __dxlog_file7,
|
|
1558
|
-
L:
|
|
1562
|
+
L: 59,
|
|
1559
1563
|
S: this,
|
|
1560
1564
|
A: [
|
|
1561
1565
|
"identity",
|
|
@@ -1589,7 +1593,7 @@ var IdentityServiceImpl = class extends Resource {
|
|
|
1589
1593
|
async updateProfile(profile) {
|
|
1590
1594
|
invariant4(this._identityManager.identity, "Identity not initialized.", {
|
|
1591
1595
|
F: __dxlog_file7,
|
|
1592
|
-
L:
|
|
1596
|
+
L: 89,
|
|
1593
1597
|
S: this,
|
|
1594
1598
|
A: [
|
|
1595
1599
|
"this._identityManager.identity",
|
|
@@ -1603,7 +1607,7 @@ var IdentityServiceImpl = class extends Resource {
|
|
|
1603
1607
|
async signPresentation({ presentation, nonce }) {
|
|
1604
1608
|
invariant4(this._identityManager.identity, "Identity not initialized.", {
|
|
1605
1609
|
F: __dxlog_file7,
|
|
1606
|
-
L:
|
|
1610
|
+
L: 96,
|
|
1607
1611
|
S: this,
|
|
1608
1612
|
A: [
|
|
1609
1613
|
"this._identityManager.identity",
|
|
@@ -1619,9 +1623,11 @@ var IdentityServiceImpl = class extends Resource {
|
|
|
1619
1623
|
});
|
|
1620
1624
|
}
|
|
1621
1625
|
async _fixIdentityWithoutDefaultSpace(identity) {
|
|
1622
|
-
let
|
|
1626
|
+
let recodedDefaultSpace = false;
|
|
1627
|
+
let foundDefaultSpace = false;
|
|
1623
1628
|
const dataSpaceManager = this._dataSpaceManagerProvider();
|
|
1624
|
-
|
|
1629
|
+
const recordedDefaultSpaceTrigger = new Trigger3();
|
|
1630
|
+
const allProcessed = safeAwaitAll(dataSpaceManager.spaces.values(), async (space) => {
|
|
1625
1631
|
if (space.state === SpaceState.CLOSED) {
|
|
1626
1632
|
await space.open();
|
|
1627
1633
|
const requiresMigration = space.stateUpdate.waitForCondition(() => space.state === SpaceState.REQUIRES_MIGRATION);
|
|
@@ -1631,12 +1637,29 @@ var IdentityServiceImpl = class extends Resource {
|
|
|
1631
1637
|
]);
|
|
1632
1638
|
}
|
|
1633
1639
|
if (await dataSpaceManager.isDefaultSpace(space)) {
|
|
1640
|
+
if (foundDefaultSpace) {
|
|
1641
|
+
log6.warn("Multiple default spaces found. Using the first one.", {
|
|
1642
|
+
duplicate: space.id
|
|
1643
|
+
}, {
|
|
1644
|
+
F: __dxlog_file7,
|
|
1645
|
+
L: 127,
|
|
1646
|
+
S: this,
|
|
1647
|
+
C: (f, a) => f(...a)
|
|
1648
|
+
});
|
|
1649
|
+
return;
|
|
1650
|
+
}
|
|
1651
|
+
foundDefaultSpace = true;
|
|
1634
1652
|
await identity.updateDefaultSpace(space.id);
|
|
1635
|
-
|
|
1636
|
-
|
|
1653
|
+
recodedDefaultSpace = true;
|
|
1654
|
+
recordedDefaultSpaceTrigger.wake();
|
|
1637
1655
|
}
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1656
|
+
});
|
|
1657
|
+
await Promise.race([
|
|
1658
|
+
allProcessed,
|
|
1659
|
+
recordedDefaultSpaceTrigger.wait(),
|
|
1660
|
+
sleep(DEFAULT_SPACE_SEARCH_TIMEOUT)
|
|
1661
|
+
]);
|
|
1662
|
+
if (!recodedDefaultSpace) {
|
|
1640
1663
|
await this._createDefaultSpace(dataSpaceManager);
|
|
1641
1664
|
}
|
|
1642
1665
|
}
|
|
@@ -1760,7 +1783,7 @@ import { ContextDisposedError as ContextDisposedError2 } from "@dxos/context";
|
|
|
1760
1783
|
import { createKeyPair, sign } from "@dxos/crypto";
|
|
1761
1784
|
import { invariant as invariant9 } from "@dxos/invariant";
|
|
1762
1785
|
import { PublicKey as PublicKey7 } from "@dxos/keys";
|
|
1763
|
-
import { log as
|
|
1786
|
+
import { log as log10 } from "@dxos/log";
|
|
1764
1787
|
import { createTeleportProtocolFactory } from "@dxos/network-manager";
|
|
1765
1788
|
import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError3, trace as trace5 } from "@dxos/protocols";
|
|
1766
1789
|
import { Invitation as Invitation4 } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -1769,10 +1792,10 @@ import { Options as Options4 } from "@dxos/protocols/proto/dxos/halo/invitations
|
|
|
1769
1792
|
import { ComplexSet as ComplexSet3 } from "@dxos/util";
|
|
1770
1793
|
|
|
1771
1794
|
// packages/sdk/client-services/src/packlets/invitations/invitation-guest-extenstion.ts
|
|
1772
|
-
import { Trigger as
|
|
1795
|
+
import { Trigger as Trigger4 } from "@dxos/async";
|
|
1773
1796
|
import { cancelWithContext as cancelWithContext2, Context as Context4 } from "@dxos/context";
|
|
1774
1797
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
1775
|
-
import { log as
|
|
1798
|
+
import { log as log7 } from "@dxos/log";
|
|
1776
1799
|
import { InvalidInvitationExtensionRoleError, schema as schema2 } from "@dxos/protocols";
|
|
1777
1800
|
import { Options } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
1778
1801
|
import { RpcExtension } from "@dxos/teleport";
|
|
@@ -1812,7 +1835,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1812
1835
|
this._invitationFlowMutex = _invitationFlowMutex;
|
|
1813
1836
|
this._callbacks = _callbacks;
|
|
1814
1837
|
this._ctx = new Context4();
|
|
1815
|
-
this._remoteOptionsTrigger = new
|
|
1838
|
+
this._remoteOptionsTrigger = new Trigger4();
|
|
1816
1839
|
this._invitationFlowLock = null;
|
|
1817
1840
|
}
|
|
1818
1841
|
hasFlowLock() {
|
|
@@ -1849,14 +1872,14 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1849
1872
|
async onOpen(context) {
|
|
1850
1873
|
await super.onOpen(context);
|
|
1851
1874
|
try {
|
|
1852
|
-
|
|
1875
|
+
log7("guest acquire lock", void 0, {
|
|
1853
1876
|
F: __dxlog_file9,
|
|
1854
1877
|
L: 84,
|
|
1855
1878
|
S: this,
|
|
1856
1879
|
C: (f, a) => f(...a)
|
|
1857
1880
|
});
|
|
1858
1881
|
this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
|
|
1859
|
-
|
|
1882
|
+
log7("guest lock acquired", void 0, {
|
|
1860
1883
|
F: __dxlog_file9,
|
|
1861
1884
|
L: 86,
|
|
1862
1885
|
S: this,
|
|
@@ -1865,7 +1888,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1865
1888
|
await cancelWithContext2(this._ctx, this.rpc.InvitationHostService.options({
|
|
1866
1889
|
role: Options.Role.GUEST
|
|
1867
1890
|
}));
|
|
1868
|
-
|
|
1891
|
+
log7("options sent", void 0, {
|
|
1869
1892
|
F: __dxlog_file9,
|
|
1870
1893
|
L: 88,
|
|
1871
1894
|
S: this,
|
|
@@ -1874,7 +1897,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1874
1897
|
await cancelWithContext2(this._ctx, this._remoteOptionsTrigger.wait({
|
|
1875
1898
|
timeout: OPTIONS_TIMEOUT
|
|
1876
1899
|
}));
|
|
1877
|
-
|
|
1900
|
+
log7("options received", void 0, {
|
|
1878
1901
|
F: __dxlog_file9,
|
|
1879
1902
|
L: 90,
|
|
1880
1903
|
S: this,
|
|
@@ -1908,7 +1931,7 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1908
1931
|
if (this._invitationFlowLock != null) {
|
|
1909
1932
|
this._invitationFlowLock.release();
|
|
1910
1933
|
this._invitationFlowLock = null;
|
|
1911
|
-
|
|
1934
|
+
log7("invitation flow lock released", void 0, {
|
|
1912
1935
|
F: __dxlog_file9,
|
|
1913
1936
|
L: 123,
|
|
1914
1937
|
S: this,
|
|
@@ -1919,12 +1942,12 @@ var InvitationGuestExtension = class extends RpcExtension {
|
|
|
1919
1942
|
};
|
|
1920
1943
|
|
|
1921
1944
|
// packages/sdk/client-services/src/packlets/invitations/invitation-host-extension.ts
|
|
1922
|
-
import { Trigger as
|
|
1945
|
+
import { Trigger as Trigger5, scheduleTask as scheduleTask2 } from "@dxos/async";
|
|
1923
1946
|
import { cancelWithContext as cancelWithContext3, Context as Context5 } from "@dxos/context";
|
|
1924
1947
|
import { randomBytes, verify } from "@dxos/crypto";
|
|
1925
1948
|
import { invariant as invariant7, InvariantViolation } from "@dxos/invariant";
|
|
1926
1949
|
import { PublicKey as PublicKey5 } from "@dxos/keys";
|
|
1927
|
-
import { log as
|
|
1950
|
+
import { log as log8 } from "@dxos/log";
|
|
1928
1951
|
import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2, schema as schema3, trace as trace4 } from "@dxos/protocols";
|
|
1929
1952
|
import { Invitation as Invitation3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
1930
1953
|
import { AuthenticationResponse, Options as Options2 } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
@@ -1945,12 +1968,12 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
1945
1968
|
this._invitationFlowMutex = _invitationFlowMutex;
|
|
1946
1969
|
this._callbacks = _callbacks;
|
|
1947
1970
|
this._ctx = new Context5();
|
|
1948
|
-
this._remoteOptionsTrigger = new
|
|
1971
|
+
this._remoteOptionsTrigger = new Trigger5();
|
|
1949
1972
|
this._challenge = void 0;
|
|
1950
1973
|
this.guestProfile = void 0;
|
|
1951
1974
|
this.authenticationPassed = false;
|
|
1952
1975
|
this.authenticationRetry = 0;
|
|
1953
|
-
this.completedTrigger = new
|
|
1976
|
+
this.completedTrigger = new Trigger5();
|
|
1954
1977
|
this._invitationFlowLock = null;
|
|
1955
1978
|
}
|
|
1956
1979
|
hasFlowLock() {
|
|
@@ -1977,7 +2000,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
1977
2000
|
introduce: async (request) => {
|
|
1978
2001
|
const { profile, invitationId } = request;
|
|
1979
2002
|
const traceId = PublicKey5.random().toHex();
|
|
1980
|
-
|
|
2003
|
+
log8.trace("dxos.sdk.invitation-handler.host.introduce", trace4.begin({
|
|
1981
2004
|
id: traceId
|
|
1982
2005
|
}), {
|
|
1983
2006
|
F: __dxlog_file10,
|
|
@@ -1988,7 +2011,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
1988
2011
|
const invitation = this._requireActiveInvitation();
|
|
1989
2012
|
this._assertInvitationState(Invitation3.State.CONNECTED);
|
|
1990
2013
|
if (invitationId !== invitation?.invitationId) {
|
|
1991
|
-
|
|
2014
|
+
log8.warn("incorrect invitationId", {
|
|
1992
2015
|
expected: invitation.invitationId,
|
|
1993
2016
|
actual: invitationId
|
|
1994
2017
|
}, {
|
|
@@ -2003,7 +2026,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2003
2026
|
authMethod: Invitation3.AuthMethod.NONE
|
|
2004
2027
|
};
|
|
2005
2028
|
}
|
|
2006
|
-
|
|
2029
|
+
log8("guest introduced themselves", {
|
|
2007
2030
|
guestProfile: profile
|
|
2008
2031
|
}, {
|
|
2009
2032
|
F: __dxlog_file10,
|
|
@@ -2014,7 +2037,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2014
2037
|
this.guestProfile = profile;
|
|
2015
2038
|
this._callbacks.onStateUpdate(Invitation3.State.READY_FOR_AUTHENTICATION);
|
|
2016
2039
|
this._challenge = invitation.authMethod === Invitation3.AuthMethod.KNOWN_PUBLIC_KEY ? randomBytes(32) : void 0;
|
|
2017
|
-
|
|
2040
|
+
log8.trace("dxos.sdk.invitation-handler.host.introduce", trace4.end({
|
|
2018
2041
|
id: traceId
|
|
2019
2042
|
}), {
|
|
2020
2043
|
F: __dxlog_file10,
|
|
@@ -2029,7 +2052,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2029
2052
|
},
|
|
2030
2053
|
authenticate: async ({ authCode: code, signedChallenge }) => {
|
|
2031
2054
|
const traceId = PublicKey5.random().toHex();
|
|
2032
|
-
|
|
2055
|
+
log8.trace("dxos.sdk.invitation-handler.host.authenticate", trace4.begin({
|
|
2033
2056
|
id: traceId
|
|
2034
2057
|
}), {
|
|
2035
2058
|
F: __dxlog_file10,
|
|
@@ -2038,7 +2061,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2038
2061
|
C: (f, a) => f(...a)
|
|
2039
2062
|
});
|
|
2040
2063
|
const invitation = this._requireActiveInvitation();
|
|
2041
|
-
|
|
2064
|
+
log8("received authentication request", {
|
|
2042
2065
|
authCode: code
|
|
2043
2066
|
}, {
|
|
2044
2067
|
F: __dxlog_file10,
|
|
@@ -2054,7 +2077,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2054
2077
|
this._callbacks.onStateUpdate(Invitation3.State.AUTHENTICATING);
|
|
2055
2078
|
switch (invitation.authMethod) {
|
|
2056
2079
|
case Invitation3.AuthMethod.NONE: {
|
|
2057
|
-
|
|
2080
|
+
log8("authentication not required", void 0, {
|
|
2058
2081
|
F: __dxlog_file10,
|
|
2059
2082
|
L: 152,
|
|
2060
2083
|
S: this,
|
|
@@ -2090,7 +2113,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2090
2113
|
break;
|
|
2091
2114
|
}
|
|
2092
2115
|
default: {
|
|
2093
|
-
|
|
2116
|
+
log8.error("invalid authentication method", {
|
|
2094
2117
|
authMethod: invitation.authMethod
|
|
2095
2118
|
}, {
|
|
2096
2119
|
F: __dxlog_file10,
|
|
@@ -2112,7 +2135,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2112
2135
|
status
|
|
2113
2136
|
};
|
|
2114
2137
|
}
|
|
2115
|
-
|
|
2138
|
+
log8.trace("dxos.sdk.invitation-handler.host.authenticate", trace4.end({
|
|
2116
2139
|
id: traceId,
|
|
2117
2140
|
data: {
|
|
2118
2141
|
status
|
|
@@ -2129,7 +2152,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2129
2152
|
},
|
|
2130
2153
|
admit: async (request) => {
|
|
2131
2154
|
const traceId = PublicKey5.random().toHex();
|
|
2132
|
-
|
|
2155
|
+
log8.trace("dxos.sdk.invitation-handler.host.admit", trace4.begin({
|
|
2133
2156
|
id: traceId
|
|
2134
2157
|
}), {
|
|
2135
2158
|
F: __dxlog_file10,
|
|
@@ -2146,7 +2169,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2146
2169
|
}
|
|
2147
2170
|
}
|
|
2148
2171
|
const response = await this._callbacks.admit(request);
|
|
2149
|
-
|
|
2172
|
+
log8.trace("dxos.sdk.invitation-handler.host.admit", trace4.end({
|
|
2150
2173
|
id: traceId
|
|
2151
2174
|
}), {
|
|
2152
2175
|
F: __dxlog_file10,
|
|
@@ -2166,14 +2189,14 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2166
2189
|
async onOpen(context) {
|
|
2167
2190
|
await super.onOpen(context);
|
|
2168
2191
|
try {
|
|
2169
|
-
|
|
2192
|
+
log8("host acquire lock", void 0, {
|
|
2170
2193
|
F: __dxlog_file10,
|
|
2171
2194
|
L: 237,
|
|
2172
2195
|
S: this,
|
|
2173
2196
|
C: (f, a) => f(...a)
|
|
2174
2197
|
});
|
|
2175
2198
|
this._invitationFlowLock = await tryAcquireBeforeContextDisposed(this._ctx, this._invitationFlowMutex);
|
|
2176
|
-
|
|
2199
|
+
log8("host lock acquired", void 0, {
|
|
2177
2200
|
F: __dxlog_file10,
|
|
2178
2201
|
L: 239,
|
|
2179
2202
|
S: this,
|
|
@@ -2184,7 +2207,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2184
2207
|
await this.rpc.InvitationHostService.options({
|
|
2185
2208
|
role: Options2.Role.HOST
|
|
2186
2209
|
});
|
|
2187
|
-
|
|
2210
|
+
log8("options sent", void 0, {
|
|
2188
2211
|
F: __dxlog_file10,
|
|
2189
2212
|
L: 243,
|
|
2190
2213
|
S: this,
|
|
@@ -2193,7 +2216,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2193
2216
|
await cancelWithContext3(this._ctx, this._remoteOptionsTrigger.wait({
|
|
2194
2217
|
timeout: OPTIONS_TIMEOUT2
|
|
2195
2218
|
}));
|
|
2196
|
-
|
|
2219
|
+
log8("options received", void 0, {
|
|
2197
2220
|
F: __dxlog_file10,
|
|
2198
2221
|
L: 245,
|
|
2199
2222
|
S: this,
|
|
@@ -2247,7 +2270,7 @@ var InvitationHostExtension = class extends RpcExtension2 {
|
|
|
2247
2270
|
if (this._invitationFlowLock != null) {
|
|
2248
2271
|
this._invitationFlowLock?.release();
|
|
2249
2272
|
this._invitationFlowLock = null;
|
|
2250
|
-
|
|
2273
|
+
log8("invitation flow lock released", void 0, {
|
|
2251
2274
|
F: __dxlog_file10,
|
|
2252
2275
|
L: 300,
|
|
2253
2276
|
S: this,
|
|
@@ -2261,7 +2284,7 @@ var isAuthenticationRequired = (invitation) => invitation.authMethod !== Invitat
|
|
|
2261
2284
|
// packages/sdk/client-services/src/packlets/invitations/invitation-topology.ts
|
|
2262
2285
|
import { invariant as invariant8 } from "@dxos/invariant";
|
|
2263
2286
|
import { PublicKey as PublicKey6 } from "@dxos/keys";
|
|
2264
|
-
import { log as
|
|
2287
|
+
import { log as log9 } from "@dxos/log";
|
|
2265
2288
|
import { Options as Options3 } from "@dxos/protocols/proto/dxos/halo/invitations";
|
|
2266
2289
|
import { ComplexSet as ComplexSet2 } from "@dxos/util";
|
|
2267
2290
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitation-topology.ts";
|
|
@@ -2303,7 +2326,7 @@ var InvitationTopology = class {
|
|
|
2303
2326
|
const firstUnknownPeer = candidates.find((peerId) => !this._seenPeers.has(peerId));
|
|
2304
2327
|
this._seenPeers = new ComplexSet2(PublicKey6.hash, allPeers.filter((peerId) => this._seenPeers.has(peerId)));
|
|
2305
2328
|
if (firstUnknownPeer != null) {
|
|
2306
|
-
|
|
2329
|
+
log9("invitation connect", {
|
|
2307
2330
|
ownPeerId,
|
|
2308
2331
|
remotePeerId: firstUnknownPeer
|
|
2309
2332
|
}, {
|
|
@@ -2388,7 +2411,7 @@ var InvitationsHandler = class {
|
|
|
2388
2411
|
scheduleTask3(connectionCtx, async () => {
|
|
2389
2412
|
const traceId = PublicKey7.random().toHex();
|
|
2390
2413
|
try {
|
|
2391
|
-
|
|
2414
|
+
log10.trace("dxos.sdk.invitations-handler.host.onOpen", trace5.begin({
|
|
2392
2415
|
id: traceId
|
|
2393
2416
|
}), {
|
|
2394
2417
|
F: __dxlog_file12,
|
|
@@ -2396,7 +2419,7 @@ var InvitationsHandler = class {
|
|
|
2396
2419
|
S: this,
|
|
2397
2420
|
C: (f, a) => f(...a)
|
|
2398
2421
|
});
|
|
2399
|
-
|
|
2422
|
+
log10("connected", {
|
|
2400
2423
|
...protocol.toJSON()
|
|
2401
2424
|
}, {
|
|
2402
2425
|
F: __dxlog_file12,
|
|
@@ -2407,7 +2430,7 @@ var InvitationsHandler = class {
|
|
|
2407
2430
|
const deviceKey = await extension.completedTrigger.wait({
|
|
2408
2431
|
timeout: invitation.timeout
|
|
2409
2432
|
});
|
|
2410
|
-
|
|
2433
|
+
log10("admitted guest", {
|
|
2411
2434
|
guest: deviceKey,
|
|
2412
2435
|
...protocol.toJSON()
|
|
2413
2436
|
}, {
|
|
@@ -2417,7 +2440,7 @@ var InvitationsHandler = class {
|
|
|
2417
2440
|
C: (f, a) => f(...a)
|
|
2418
2441
|
});
|
|
2419
2442
|
guardedState.set(extension, Invitation4.State.SUCCESS);
|
|
2420
|
-
|
|
2443
|
+
log10.trace("dxos.sdk.invitations-handler.host.onOpen", trace5.end({
|
|
2421
2444
|
id: traceId
|
|
2422
2445
|
}), {
|
|
2423
2446
|
F: __dxlog_file12,
|
|
@@ -2432,7 +2455,7 @@ var InvitationsHandler = class {
|
|
|
2432
2455
|
} catch (err) {
|
|
2433
2456
|
if (err instanceof TimeoutError) {
|
|
2434
2457
|
if (guardedState.set(extension, Invitation4.State.TIMEOUT)) {
|
|
2435
|
-
|
|
2458
|
+
log10("timeout", {
|
|
2436
2459
|
...protocol.toJSON()
|
|
2437
2460
|
}, {
|
|
2438
2461
|
F: __dxlog_file12,
|
|
@@ -2443,7 +2466,7 @@ var InvitationsHandler = class {
|
|
|
2443
2466
|
}
|
|
2444
2467
|
} else {
|
|
2445
2468
|
if (guardedState.error(extension, err)) {
|
|
2446
|
-
|
|
2469
|
+
log10.error("failed", err, {
|
|
2447
2470
|
F: __dxlog_file12,
|
|
2448
2471
|
L: 133,
|
|
2449
2472
|
S: this,
|
|
@@ -2451,7 +2474,7 @@ var InvitationsHandler = class {
|
|
|
2451
2474
|
});
|
|
2452
2475
|
}
|
|
2453
2476
|
}
|
|
2454
|
-
|
|
2477
|
+
log10.trace("dxos.sdk.invitations-handler.host.onOpen", trace5.error({
|
|
2455
2478
|
id: traceId,
|
|
2456
2479
|
error: err
|
|
2457
2480
|
}), {
|
|
@@ -2466,7 +2489,7 @@ var InvitationsHandler = class {
|
|
|
2466
2489
|
},
|
|
2467
2490
|
onError: (err) => {
|
|
2468
2491
|
if (err instanceof InvalidInvitationExtensionRoleError3) {
|
|
2469
|
-
|
|
2492
|
+
log10("invalid role", {
|
|
2470
2493
|
...err.context
|
|
2471
2494
|
}, {
|
|
2472
2495
|
F: __dxlog_file12,
|
|
@@ -2478,7 +2501,7 @@ var InvitationsHandler = class {
|
|
|
2478
2501
|
}
|
|
2479
2502
|
if (err instanceof TimeoutError) {
|
|
2480
2503
|
if (guardedState.set(extension, Invitation4.State.TIMEOUT)) {
|
|
2481
|
-
|
|
2504
|
+
log10("timeout", {
|
|
2482
2505
|
err
|
|
2483
2506
|
}, {
|
|
2484
2507
|
F: __dxlog_file12,
|
|
@@ -2489,7 +2512,7 @@ var InvitationsHandler = class {
|
|
|
2489
2512
|
}
|
|
2490
2513
|
} else {
|
|
2491
2514
|
if (guardedState.error(extension, err)) {
|
|
2492
|
-
|
|
2515
|
+
log10.error("failed", err, {
|
|
2493
2516
|
F: __dxlog_file12,
|
|
2494
2517
|
L: 153,
|
|
2495
2518
|
S: this,
|
|
@@ -2503,7 +2526,7 @@ var InvitationsHandler = class {
|
|
|
2503
2526
|
};
|
|
2504
2527
|
if (invitation.lifetime && invitation.created) {
|
|
2505
2528
|
if (invitation.created.getTime() + invitation.lifetime * 1e3 < Date.now()) {
|
|
2506
|
-
|
|
2529
|
+
log10.warn("invitation has already expired", void 0, {
|
|
2507
2530
|
F: __dxlog_file12,
|
|
2508
2531
|
L: 164,
|
|
2509
2532
|
S: this,
|
|
@@ -2540,7 +2563,7 @@ var InvitationsHandler = class {
|
|
|
2540
2563
|
const guardedState = this._createGuardedState(ctx, invitation, stream);
|
|
2541
2564
|
const shouldCancelInvitationFlow = (extension) => {
|
|
2542
2565
|
const isLockedByAnotherConnection = guardedState.mutex.isLocked() && !extension.hasFlowLock();
|
|
2543
|
-
|
|
2566
|
+
log10("should cancel invitation flow", {
|
|
2544
2567
|
isLockedByAnotherConnection,
|
|
2545
2568
|
invitationType: Invitation4.Type.DELEGATED,
|
|
2546
2569
|
triedPeers: triedPeersIds.size
|
|
@@ -2568,7 +2591,7 @@ var InvitationsHandler = class {
|
|
|
2568
2591
|
return;
|
|
2569
2592
|
}
|
|
2570
2593
|
connectionCtx.onDispose(async () => {
|
|
2571
|
-
|
|
2594
|
+
log10("extension disposed", {
|
|
2572
2595
|
admitted,
|
|
2573
2596
|
currentState: guardedState.current.state
|
|
2574
2597
|
}, {
|
|
@@ -2587,7 +2610,7 @@ var InvitationsHandler = class {
|
|
|
2587
2610
|
scheduleTask3(connectionCtx, async () => {
|
|
2588
2611
|
const traceId = PublicKey7.random().toHex();
|
|
2589
2612
|
try {
|
|
2590
|
-
|
|
2613
|
+
log10.trace("dxos.sdk.invitations-handler.guest.onOpen", trace5.begin({
|
|
2591
2614
|
id: traceId
|
|
2592
2615
|
}), {
|
|
2593
2616
|
F: __dxlog_file12,
|
|
@@ -2599,7 +2622,7 @@ var InvitationsHandler = class {
|
|
|
2599
2622
|
guardedState.set(extension, Invitation4.State.TIMEOUT);
|
|
2600
2623
|
extensionCtx.close();
|
|
2601
2624
|
}, timeout);
|
|
2602
|
-
|
|
2625
|
+
log10("connected", {
|
|
2603
2626
|
...protocol.toJSON()
|
|
2604
2627
|
}, {
|
|
2605
2628
|
F: __dxlog_file12,
|
|
@@ -2608,7 +2631,7 @@ var InvitationsHandler = class {
|
|
|
2608
2631
|
C: (f, a) => f(...a)
|
|
2609
2632
|
});
|
|
2610
2633
|
guardedState.set(extension, Invitation4.State.CONNECTED);
|
|
2611
|
-
|
|
2634
|
+
log10("introduce", {
|
|
2612
2635
|
...protocol.toJSON()
|
|
2613
2636
|
}, {
|
|
2614
2637
|
F: __dxlog_file12,
|
|
@@ -2620,7 +2643,7 @@ var InvitationsHandler = class {
|
|
|
2620
2643
|
invitationId: invitation.invitationId,
|
|
2621
2644
|
...protocol.createIntroduction()
|
|
2622
2645
|
});
|
|
2623
|
-
|
|
2646
|
+
log10("introduce response", {
|
|
2624
2647
|
...protocol.toJSON(),
|
|
2625
2648
|
response: introductionResponse
|
|
2626
2649
|
}, {
|
|
@@ -2642,7 +2665,7 @@ var InvitationsHandler = class {
|
|
|
2642
2665
|
break;
|
|
2643
2666
|
}
|
|
2644
2667
|
}
|
|
2645
|
-
|
|
2668
|
+
log10("request admission", {
|
|
2646
2669
|
...protocol.toJSON()
|
|
2647
2670
|
}, {
|
|
2648
2671
|
F: __dxlog_file12,
|
|
@@ -2654,7 +2677,7 @@ var InvitationsHandler = class {
|
|
|
2654
2677
|
const admissionResponse = await extension.rpc.InvitationHostService.admit(admissionRequest);
|
|
2655
2678
|
admitted = true;
|
|
2656
2679
|
const result = await protocol.accept(admissionResponse, admissionRequest);
|
|
2657
|
-
|
|
2680
|
+
log10("admitted by host", {
|
|
2658
2681
|
...protocol.toJSON()
|
|
2659
2682
|
}, {
|
|
2660
2683
|
F: __dxlog_file12,
|
|
@@ -2667,7 +2690,7 @@ var InvitationsHandler = class {
|
|
|
2667
2690
|
...result,
|
|
2668
2691
|
state: Invitation4.State.SUCCESS
|
|
2669
2692
|
});
|
|
2670
|
-
|
|
2693
|
+
log10.trace("dxos.sdk.invitations-handler.guest.onOpen", trace5.end({
|
|
2671
2694
|
id: traceId
|
|
2672
2695
|
}), {
|
|
2673
2696
|
F: __dxlog_file12,
|
|
@@ -2677,7 +2700,7 @@ var InvitationsHandler = class {
|
|
|
2677
2700
|
});
|
|
2678
2701
|
} catch (err) {
|
|
2679
2702
|
if (err instanceof TimeoutError) {
|
|
2680
|
-
|
|
2703
|
+
log10("timeout", {
|
|
2681
2704
|
...protocol.toJSON()
|
|
2682
2705
|
}, {
|
|
2683
2706
|
F: __dxlog_file12,
|
|
@@ -2687,7 +2710,7 @@ var InvitationsHandler = class {
|
|
|
2687
2710
|
});
|
|
2688
2711
|
guardedState.set(extension, Invitation4.State.TIMEOUT);
|
|
2689
2712
|
} else {
|
|
2690
|
-
|
|
2713
|
+
log10("auth failed", err, {
|
|
2691
2714
|
F: __dxlog_file12,
|
|
2692
2715
|
L: 314,
|
|
2693
2716
|
S: this,
|
|
@@ -2696,7 +2719,7 @@ var InvitationsHandler = class {
|
|
|
2696
2719
|
guardedState.error(extension, err);
|
|
2697
2720
|
}
|
|
2698
2721
|
extensionCtx.close(err);
|
|
2699
|
-
|
|
2722
|
+
log10.trace("dxos.sdk.invitations-handler.guest.onOpen", trace5.error({
|
|
2700
2723
|
id: traceId,
|
|
2701
2724
|
error: err
|
|
2702
2725
|
}), {
|
|
@@ -2713,7 +2736,7 @@ var InvitationsHandler = class {
|
|
|
2713
2736
|
return;
|
|
2714
2737
|
}
|
|
2715
2738
|
if (err instanceof TimeoutError) {
|
|
2716
|
-
|
|
2739
|
+
log10("timeout", {
|
|
2717
2740
|
...protocol.toJSON()
|
|
2718
2741
|
}, {
|
|
2719
2742
|
F: __dxlog_file12,
|
|
@@ -2723,7 +2746,7 @@ var InvitationsHandler = class {
|
|
|
2723
2746
|
});
|
|
2724
2747
|
guardedState.set(extension, Invitation4.State.TIMEOUT);
|
|
2725
2748
|
} else {
|
|
2726
|
-
|
|
2749
|
+
log10("auth failed", err, {
|
|
2727
2750
|
F: __dxlog_file12,
|
|
2728
2751
|
L: 330,
|
|
2729
2752
|
S: this,
|
|
@@ -2836,7 +2859,7 @@ var InvitationsHandler = class {
|
|
|
2836
2859
|
};
|
|
2837
2860
|
}
|
|
2838
2861
|
_logStateUpdate(invitation, actor, newState) {
|
|
2839
|
-
|
|
2862
|
+
log10("invitation state update", {
|
|
2840
2863
|
actor: actor?.constructor.name,
|
|
2841
2864
|
newState: stateToString(newState),
|
|
2842
2865
|
oldState: stateToString(invitation.state)
|
|
@@ -2858,7 +2881,7 @@ var InvitationsHandler = class {
|
|
|
2858
2881
|
}
|
|
2859
2882
|
async _handleGuestOtpAuth(extension, setState, authenticated, options) {
|
|
2860
2883
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
2861
|
-
|
|
2884
|
+
log10("guest waiting for authentication code...", void 0, {
|
|
2862
2885
|
F: __dxlog_file12,
|
|
2863
2886
|
L: 462,
|
|
2864
2887
|
S: this,
|
|
@@ -2866,7 +2889,7 @@ var InvitationsHandler = class {
|
|
|
2866
2889
|
});
|
|
2867
2890
|
setState(Invitation4.State.READY_FOR_AUTHENTICATION);
|
|
2868
2891
|
const authCode = await authenticated.wait(options);
|
|
2869
|
-
|
|
2892
|
+
log10("sending authentication request", void 0, {
|
|
2870
2893
|
F: __dxlog_file12,
|
|
2871
2894
|
L: 466,
|
|
2872
2895
|
S: this,
|
|
@@ -2883,7 +2906,7 @@ var InvitationsHandler = class {
|
|
|
2883
2906
|
if (attempt === MAX_OTP_ATTEMPTS) {
|
|
2884
2907
|
throw new Error(`Maximum retry attempts: ${MAX_OTP_ATTEMPTS}`);
|
|
2885
2908
|
} else {
|
|
2886
|
-
|
|
2909
|
+
log10("retrying invalid code", {
|
|
2887
2910
|
attempt
|
|
2888
2911
|
}, {
|
|
2889
2912
|
F: __dxlog_file12,
|
|
@@ -2903,7 +2926,7 @@ var InvitationsHandler = class {
|
|
|
2903
2926
|
if (introductionResponse.challenge == null) {
|
|
2904
2927
|
throw new Error("challenge missing in the introduction");
|
|
2905
2928
|
}
|
|
2906
|
-
|
|
2929
|
+
log10("sending authentication request", void 0, {
|
|
2907
2930
|
F: __dxlog_file12,
|
|
2908
2931
|
L: 496,
|
|
2909
2932
|
S: this,
|
|
@@ -3028,7 +3051,7 @@ var InvitationsServiceImpl = class {
|
|
|
3028
3051
|
import { createAdmissionCredentials, createCancelDelegatedSpaceInvitationCredential, createDelegatedSpaceInvitationCredential, getCredentialAssertion as getCredentialAssertion2 } from "@dxos/credentials";
|
|
3029
3052
|
import { writeMessages as writeMessages2 } from "@dxos/feed-store";
|
|
3030
3053
|
import { invariant as invariant10 } from "@dxos/invariant";
|
|
3031
|
-
import { log as
|
|
3054
|
+
import { log as log11 } from "@dxos/log";
|
|
3032
3055
|
import { AlreadyJoinedError as AlreadyJoinedError2, AuthorizationError, InvalidInvitationError, SpaceNotFoundError } from "@dxos/protocols";
|
|
3033
3056
|
import { Invitation as Invitation5 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3034
3057
|
import { SpaceMember as SpaceMember2 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
@@ -3098,7 +3121,7 @@ var SpaceInvitationProtocol = class {
|
|
|
3098
3121
|
if (space.inner.spaceState.getMemberRole(identityKey) !== SpaceMember2.Role.REMOVED) {
|
|
3099
3122
|
throw new AlreadyJoinedError2();
|
|
3100
3123
|
}
|
|
3101
|
-
|
|
3124
|
+
log11("writing guest credentials", {
|
|
3102
3125
|
host: this._signingContext.deviceKey,
|
|
3103
3126
|
guest: deviceKey
|
|
3104
3127
|
}, {
|
|
@@ -3166,7 +3189,7 @@ var SpaceInvitationProtocol = class {
|
|
|
3166
3189
|
]
|
|
3167
3190
|
});
|
|
3168
3191
|
}
|
|
3169
|
-
|
|
3192
|
+
log11("writing delegate space invitation", {
|
|
3170
3193
|
host: this._signingContext.deviceKey,
|
|
3171
3194
|
id: invitation.invitationId
|
|
3172
3195
|
}, {
|
|
@@ -3227,7 +3250,7 @@ var SpaceInvitationProtocol = class {
|
|
|
3227
3250
|
""
|
|
3228
3251
|
]
|
|
3229
3252
|
});
|
|
3230
|
-
|
|
3253
|
+
log11("cancelling delegated space invitation", {
|
|
3231
3254
|
host: this._signingContext.deviceKey,
|
|
3232
3255
|
id: invitation.invitationId
|
|
3233
3256
|
}, {
|
|
@@ -3322,14 +3345,14 @@ var SpaceInvitationProtocol = class {
|
|
|
3322
3345
|
};
|
|
3323
3346
|
|
|
3324
3347
|
// packages/sdk/client-services/src/packlets/invitations/invitations-manager.ts
|
|
3325
|
-
import { Event as Event3, PushStream, TimeoutError as TimeoutError2, Trigger as
|
|
3348
|
+
import { Event as Event3, PushStream, TimeoutError as TimeoutError2, Trigger as Trigger6 } from "@dxos/async";
|
|
3326
3349
|
import { AuthenticatingInvitation, AUTHENTICATION_CODE_LENGTH, CancellableInvitation, INVITATION_TIMEOUT as INVITATION_TIMEOUT2 } from "@dxos/client-protocol";
|
|
3327
3350
|
import { Context as Context6 } from "@dxos/context";
|
|
3328
3351
|
import { generatePasscode } from "@dxos/credentials";
|
|
3329
3352
|
import { hasInvitationExpired } from "@dxos/echo-pipeline";
|
|
3330
3353
|
import { invariant as invariant11 } from "@dxos/invariant";
|
|
3331
3354
|
import { PublicKey as PublicKey8 } from "@dxos/keys";
|
|
3332
|
-
import { log as
|
|
3355
|
+
import { log as log12 } from "@dxos/log";
|
|
3333
3356
|
import { Invitation as Invitation6 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3334
3357
|
import { SpaceMember as SpaceMember3 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
3335
3358
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/invitations/invitations-manager.ts";
|
|
@@ -3374,7 +3397,7 @@ var InvitationsManager = class {
|
|
|
3374
3397
|
try {
|
|
3375
3398
|
await this._persistIfRequired(handler, stream, invitation);
|
|
3376
3399
|
} catch (err) {
|
|
3377
|
-
|
|
3400
|
+
log12.catch(err, void 0, {
|
|
3378
3401
|
F: __dxlog_file14,
|
|
3379
3402
|
L: 82,
|
|
3380
3403
|
S: this,
|
|
@@ -3416,7 +3439,7 @@ var InvitationsManager = class {
|
|
|
3416
3439
|
invitations: cInvitations.map((invitation) => invitation.get())
|
|
3417
3440
|
};
|
|
3418
3441
|
} catch (err) {
|
|
3419
|
-
|
|
3442
|
+
log12.catch(err, void 0, {
|
|
3420
3443
|
F: __dxlog_file14,
|
|
3421
3444
|
L: 110,
|
|
3422
3445
|
S: this,
|
|
@@ -3448,7 +3471,7 @@ var InvitationsManager = class {
|
|
|
3448
3471
|
return invitation;
|
|
3449
3472
|
}
|
|
3450
3473
|
async authenticate({ invitationId, authCode }) {
|
|
3451
|
-
|
|
3474
|
+
log12("authenticating...", void 0, {
|
|
3452
3475
|
F: __dxlog_file14,
|
|
3453
3476
|
L: 140,
|
|
3454
3477
|
S: this,
|
|
@@ -3465,7 +3488,7 @@ var InvitationsManager = class {
|
|
|
3465
3488
|
});
|
|
3466
3489
|
const observable = this._acceptInvitations.get(invitationId);
|
|
3467
3490
|
if (!observable) {
|
|
3468
|
-
|
|
3491
|
+
log12.warn("invalid invitation", {
|
|
3469
3492
|
invitationId
|
|
3470
3493
|
}, {
|
|
3471
3494
|
F: __dxlog_file14,
|
|
@@ -3478,7 +3501,7 @@ var InvitationsManager = class {
|
|
|
3478
3501
|
}
|
|
3479
3502
|
}
|
|
3480
3503
|
async cancelInvitation({ invitationId }) {
|
|
3481
|
-
|
|
3504
|
+
log12("cancelInvitation...", {
|
|
3482
3505
|
invitationId
|
|
3483
3506
|
}, {
|
|
3484
3507
|
F: __dxlog_file14,
|
|
@@ -3563,7 +3586,7 @@ var InvitationsManager = class {
|
|
|
3563
3586
|
}
|
|
3564
3587
|
});
|
|
3565
3588
|
ctx.onDispose(() => {
|
|
3566
|
-
|
|
3589
|
+
log12("complete", {
|
|
3567
3590
|
...handler.toJSON()
|
|
3568
3591
|
}, {
|
|
3569
3592
|
F: __dxlog_file14,
|
|
@@ -3591,12 +3614,12 @@ var InvitationsManager = class {
|
|
|
3591
3614
|
};
|
|
3592
3615
|
}
|
|
3593
3616
|
_createObservableAcceptingInvitation(handler, initialState) {
|
|
3594
|
-
const otpEnteredTrigger = new
|
|
3617
|
+
const otpEnteredTrigger = new Trigger6();
|
|
3595
3618
|
const stream = new PushStream();
|
|
3596
3619
|
const ctx = new Context6({
|
|
3597
3620
|
onError: (err) => {
|
|
3598
3621
|
if (err instanceof TimeoutError2) {
|
|
3599
|
-
|
|
3622
|
+
log12("timeout", {
|
|
3600
3623
|
...handler.toJSON()
|
|
3601
3624
|
}, {
|
|
3602
3625
|
F: __dxlog_file14,
|
|
@@ -3609,7 +3632,7 @@ var InvitationsManager = class {
|
|
|
3609
3632
|
state: Invitation6.State.TIMEOUT
|
|
3610
3633
|
});
|
|
3611
3634
|
} else {
|
|
3612
|
-
|
|
3635
|
+
log12.warn("auth failed", err, {
|
|
3613
3636
|
F: __dxlog_file14,
|
|
3614
3637
|
L: 264,
|
|
3615
3638
|
S: this,
|
|
@@ -3624,7 +3647,7 @@ var InvitationsManager = class {
|
|
|
3624
3647
|
}
|
|
3625
3648
|
});
|
|
3626
3649
|
ctx.onDispose(() => {
|
|
3627
|
-
|
|
3650
|
+
log12("complete", {
|
|
3628
3651
|
...handler.toJSON()
|
|
3629
3652
|
}, {
|
|
3630
3653
|
F: __dxlog_file14,
|
|
@@ -3671,7 +3694,7 @@ var InvitationsManager = class {
|
|
|
3671
3694
|
try {
|
|
3672
3695
|
await this._metadataStore.removeInvitation(invitation.invitationId);
|
|
3673
3696
|
} catch (err) {
|
|
3674
|
-
|
|
3697
|
+
log12.catch(err, void 0, {
|
|
3675
3698
|
F: __dxlog_file14,
|
|
3676
3699
|
L: 307,
|
|
3677
3700
|
S: this,
|
|
@@ -3687,7 +3710,7 @@ var InvitationsManager = class {
|
|
|
3687
3710
|
};
|
|
3688
3711
|
|
|
3689
3712
|
// packages/sdk/client-services/src/packlets/spaces/data-space.ts
|
|
3690
|
-
import { Event as Event6, Mutex as Mutex2, scheduleTask as scheduleTask5, sleep as
|
|
3713
|
+
import { Event as Event6, Mutex as Mutex2, scheduleTask as scheduleTask5, sleep as sleep3, synchronized, trackLeaks } from "@dxos/async";
|
|
3691
3714
|
import { AUTH_TIMEOUT as AUTH_TIMEOUT2 } from "@dxos/client-protocol";
|
|
3692
3715
|
import { Context as Context8, ContextDisposedError as ContextDisposedError3, cancelWithContext as cancelWithContext5 } from "@dxos/context";
|
|
3693
3716
|
import { timed, warnAfterTimeout } from "@dxos/debug";
|
|
@@ -3695,7 +3718,7 @@ import { createMappedFeedWriter } from "@dxos/echo-pipeline";
|
|
|
3695
3718
|
import { SpaceDocVersion } from "@dxos/echo-protocol";
|
|
3696
3719
|
import { failedInvariant } from "@dxos/invariant";
|
|
3697
3720
|
import { PublicKey as PublicKey10 } from "@dxos/keys";
|
|
3698
|
-
import { log as
|
|
3721
|
+
import { log as log15 } from "@dxos/log";
|
|
3699
3722
|
import { CancelledError, SystemError } from "@dxos/protocols";
|
|
3700
3723
|
import { SpaceState as SpaceState2 } from "@dxos/protocols/proto/dxos/client/services";
|
|
3701
3724
|
import { AdmittedFeed as AdmittedFeed3, SpaceMember as SpaceMember4 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
@@ -3756,7 +3779,7 @@ import { convertLegacyReferences, convertLegacySpaceRootDoc, findInlineObjectOfT
|
|
|
3756
3779
|
import { AutomergeDocumentLoaderImpl } from "@dxos/echo-pipeline";
|
|
3757
3780
|
import { TYPE_PROPERTIES } from "@dxos/echo-schema";
|
|
3758
3781
|
import { invariant as invariant12 } from "@dxos/invariant";
|
|
3759
|
-
import { log as
|
|
3782
|
+
import { log as log13 } from "@dxos/log";
|
|
3760
3783
|
import { CreateEpochRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
3761
3784
|
import { assignDeep } from "@dxos/util";
|
|
3762
3785
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/spaces/epoch-migrations.ts";
|
|
@@ -3782,7 +3805,7 @@ var runEpochMigration = async (ctx, context) => {
|
|
|
3782
3805
|
};
|
|
3783
3806
|
}
|
|
3784
3807
|
case CreateEpochRequest.Migration.FRAGMENT_AUTOMERGE_ROOT: {
|
|
3785
|
-
|
|
3808
|
+
log13.info("Fragmenting", void 0, {
|
|
3786
3809
|
F: __dxlog_file15,
|
|
3787
3810
|
L: 63,
|
|
3788
3811
|
S: void 0,
|
|
@@ -3895,11 +3918,11 @@ var runEpochMigration = async (ctx, context) => {
|
|
|
3895
3918
|
};
|
|
3896
3919
|
|
|
3897
3920
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
3898
|
-
import { DeferredTask, Event as Event5, scheduleTask as scheduleTask4, sleep, TimeoutError as TimeoutError3, Trigger as
|
|
3921
|
+
import { DeferredTask, Event as Event5, scheduleTask as scheduleTask4, sleep as sleep2, TimeoutError as TimeoutError3, Trigger as Trigger7 } from "@dxos/async";
|
|
3899
3922
|
import { Context as Context7, rejectOnDispose } from "@dxos/context";
|
|
3900
3923
|
import { invariant as invariant13 } from "@dxos/invariant";
|
|
3901
3924
|
import { PublicKey as PublicKey9 } from "@dxos/keys";
|
|
3902
|
-
import { log as
|
|
3925
|
+
import { log as log14 } from "@dxos/log";
|
|
3903
3926
|
import { schema as schema4 } from "@dxos/protocols";
|
|
3904
3927
|
import { RpcExtension as RpcExtension3 } from "@dxos/teleport";
|
|
3905
3928
|
import { ComplexMap as ComplexMap2, ComplexSet as ComplexSet4, entry } from "@dxos/util";
|
|
@@ -3928,7 +3951,7 @@ var NotarizationPlugin = class {
|
|
|
3928
3951
|
* Request credentials to be notarized.
|
|
3929
3952
|
*/
|
|
3930
3953
|
async notarize({ ctx: opCtx, credentials, timeout = DEFAULT_NOTARIZE_TIMEOUT, retryTimeout = DEFAULT_RETRY_TIMEOUT, successDelay = DEFAULT_SUCCESS_DELAY }) {
|
|
3931
|
-
|
|
3954
|
+
log14("notarize", {
|
|
3932
3955
|
credentials
|
|
3933
3956
|
}, {
|
|
3934
3957
|
F: __dxlog_file16,
|
|
@@ -3945,10 +3968,10 @@ var NotarizationPlugin = class {
|
|
|
3945
3968
|
"'Credentials must have an id'"
|
|
3946
3969
|
]
|
|
3947
3970
|
});
|
|
3948
|
-
const errors = new
|
|
3971
|
+
const errors = new Trigger7();
|
|
3949
3972
|
const ctx = this._ctx.derive({
|
|
3950
3973
|
onError: (err) => {
|
|
3951
|
-
|
|
3974
|
+
log14.warn("Notarization error", {
|
|
3952
3975
|
err
|
|
3953
3976
|
}, {
|
|
3954
3977
|
F: __dxlog_file16,
|
|
@@ -3963,7 +3986,7 @@ var NotarizationPlugin = class {
|
|
|
3963
3986
|
opCtx?.onDispose(() => ctx.dispose());
|
|
3964
3987
|
if (timeout !== 0) {
|
|
3965
3988
|
scheduleTask4(ctx, () => {
|
|
3966
|
-
|
|
3989
|
+
log14.warn("Notarization timeout", {
|
|
3967
3990
|
timeout,
|
|
3968
3991
|
peers: Array.from(this._extensions).map((extension) => extension.remotePeerId)
|
|
3969
3992
|
}, {
|
|
@@ -3987,7 +4010,7 @@ var NotarizationPlugin = class {
|
|
|
3987
4010
|
...this._extensions
|
|
3988
4011
|
].find((peer2) => !peersTried.has(peer2));
|
|
3989
4012
|
if (!peer) {
|
|
3990
|
-
|
|
4013
|
+
log14.info("Exhausted all peers to notarize with", {
|
|
3991
4014
|
retryIn: retryTimeout
|
|
3992
4015
|
}, {
|
|
3993
4016
|
F: __dxlog_file16,
|
|
@@ -4000,7 +4023,7 @@ var NotarizationPlugin = class {
|
|
|
4000
4023
|
return;
|
|
4001
4024
|
}
|
|
4002
4025
|
peersTried.add(peer);
|
|
4003
|
-
|
|
4026
|
+
log14("try notarizing", {
|
|
4004
4027
|
peer: peer.localPeerId,
|
|
4005
4028
|
credentialId: credentials.map((credential) => credential.id)
|
|
4006
4029
|
}, {
|
|
@@ -4012,16 +4035,16 @@ var NotarizationPlugin = class {
|
|
|
4012
4035
|
await peer.rpc.NotarizationService.notarize({
|
|
4013
4036
|
credentials: credentials.filter((credential) => !this._processedCredentials.has(credential.id))
|
|
4014
4037
|
});
|
|
4015
|
-
|
|
4038
|
+
log14("success", void 0, {
|
|
4016
4039
|
F: __dxlog_file16,
|
|
4017
4040
|
L: 147,
|
|
4018
4041
|
S: this,
|
|
4019
4042
|
C: (f, a) => f(...a)
|
|
4020
4043
|
});
|
|
4021
|
-
await
|
|
4044
|
+
await sleep2(successDelay);
|
|
4022
4045
|
} catch (err) {
|
|
4023
4046
|
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
4024
|
-
|
|
4047
|
+
log14.info("error notarizing (recoverable)", err, {
|
|
4025
4048
|
F: __dxlog_file16,
|
|
4026
4049
|
L: 151,
|
|
4027
4050
|
S: this,
|
|
@@ -4039,7 +4062,7 @@ var NotarizationPlugin = class {
|
|
|
4039
4062
|
allNotarized,
|
|
4040
4063
|
errors.wait()
|
|
4041
4064
|
]);
|
|
4042
|
-
|
|
4065
|
+
log14("done", void 0, {
|
|
4043
4066
|
F: __dxlog_file16,
|
|
4044
4067
|
L: 162,
|
|
4045
4068
|
S: this,
|
|
@@ -4076,7 +4099,7 @@ var NotarizationPlugin = class {
|
|
|
4076
4099
|
if (this._processedCredentials.has(id)) {
|
|
4077
4100
|
return;
|
|
4078
4101
|
}
|
|
4079
|
-
await entry(this._processCredentialsTriggers, id).orInsert(new
|
|
4102
|
+
await entry(this._processCredentialsTriggers, id).orInsert(new Trigger7()).value.wait();
|
|
4080
4103
|
}
|
|
4081
4104
|
/**
|
|
4082
4105
|
* Requests from other peers to notarize credentials.
|
|
@@ -4104,7 +4127,7 @@ var NotarizationPlugin = class {
|
|
|
4104
4127
|
createExtension() {
|
|
4105
4128
|
const extension = new NotarizationTeleportExtension({
|
|
4106
4129
|
onOpen: async () => {
|
|
4107
|
-
|
|
4130
|
+
log14("extension opened", {
|
|
4108
4131
|
peer: extension.localPeerId
|
|
4109
4132
|
}, {
|
|
4110
4133
|
F: __dxlog_file16,
|
|
@@ -4116,7 +4139,7 @@ var NotarizationPlugin = class {
|
|
|
4116
4139
|
this._extensionOpened.emit();
|
|
4117
4140
|
},
|
|
4118
4141
|
onClose: async () => {
|
|
4119
|
-
|
|
4142
|
+
log14("extension closed", {
|
|
4120
4143
|
peer: extension.localPeerId
|
|
4121
4144
|
}, {
|
|
4122
4145
|
F: __dxlog_file16,
|
|
@@ -4270,7 +4293,7 @@ var DataSpace = class {
|
|
|
4270
4293
|
});
|
|
4271
4294
|
this._cache = params.cache;
|
|
4272
4295
|
this._state = params.initialState;
|
|
4273
|
-
|
|
4296
|
+
log15("new state", {
|
|
4274
4297
|
state: SpaceState2[this._state]
|
|
4275
4298
|
}, {
|
|
4276
4299
|
F: __dxlog_file17,
|
|
@@ -4330,7 +4353,7 @@ var DataSpace = class {
|
|
|
4330
4353
|
await this._inner.spaceState.addCredentialProcessor(this._automergeSpaceState);
|
|
4331
4354
|
await this._inner.open(new Context8());
|
|
4332
4355
|
this._state = SpaceState2.CONTROL_ONLY;
|
|
4333
|
-
|
|
4356
|
+
log15("new state", {
|
|
4334
4357
|
state: SpaceState2[this._state]
|
|
4335
4358
|
}, {
|
|
4336
4359
|
F: __dxlog_file17,
|
|
@@ -4348,7 +4371,7 @@ var DataSpace = class {
|
|
|
4348
4371
|
async _close() {
|
|
4349
4372
|
await this._callbacks.beforeClose?.();
|
|
4350
4373
|
this._state = SpaceState2.CLOSED;
|
|
4351
|
-
|
|
4374
|
+
log15("new state", {
|
|
4352
4375
|
state: SpaceState2[this._state]
|
|
4353
4376
|
}, {
|
|
4354
4377
|
F: __dxlog_file17,
|
|
@@ -4383,7 +4406,7 @@ var DataSpace = class {
|
|
|
4383
4406
|
await this.initializeDataPipeline();
|
|
4384
4407
|
} catch (err) {
|
|
4385
4408
|
if (err instanceof CancelledError || err instanceof ContextDisposedError3) {
|
|
4386
|
-
|
|
4409
|
+
log15("data pipeline initialization cancelled", err, {
|
|
4387
4410
|
F: __dxlog_file17,
|
|
4388
4411
|
L: 265,
|
|
4389
4412
|
S: this,
|
|
@@ -4391,14 +4414,14 @@ var DataSpace = class {
|
|
|
4391
4414
|
});
|
|
4392
4415
|
return;
|
|
4393
4416
|
}
|
|
4394
|
-
|
|
4417
|
+
log15.error("Error initializing data pipeline", err, {
|
|
4395
4418
|
F: __dxlog_file17,
|
|
4396
4419
|
L: 269,
|
|
4397
4420
|
S: this,
|
|
4398
4421
|
C: (f, a) => f(...a)
|
|
4399
4422
|
});
|
|
4400
4423
|
this._state = SpaceState2.ERROR;
|
|
4401
|
-
|
|
4424
|
+
log15("new state", {
|
|
4402
4425
|
state: SpaceState2[this._state]
|
|
4403
4426
|
}, {
|
|
4404
4427
|
F: __dxlog_file17,
|
|
@@ -4418,7 +4441,7 @@ var DataSpace = class {
|
|
|
4418
4441
|
throw new SystemError("Invalid operation");
|
|
4419
4442
|
}
|
|
4420
4443
|
this._state = SpaceState2.INITIALIZING;
|
|
4421
|
-
|
|
4444
|
+
log15("new state", {
|
|
4422
4445
|
state: SpaceState2[this._state]
|
|
4423
4446
|
}, {
|
|
4424
4447
|
F: __dxlog_file17,
|
|
@@ -4427,7 +4450,7 @@ var DataSpace = class {
|
|
|
4427
4450
|
C: (f, a) => f(...a)
|
|
4428
4451
|
});
|
|
4429
4452
|
await this._initializeAndReadControlPipeline();
|
|
4430
|
-
await
|
|
4453
|
+
await sleep3(1);
|
|
4431
4454
|
const ready = this.stateUpdate.waitForCondition(() => this._state === SpaceState2.READY);
|
|
4432
4455
|
this._automergeSpaceState.startProcessingRootDocs();
|
|
4433
4456
|
await ready;
|
|
@@ -4435,7 +4458,7 @@ var DataSpace = class {
|
|
|
4435
4458
|
async _enterReadyState() {
|
|
4436
4459
|
await this._callbacks.beforeReady?.();
|
|
4437
4460
|
this._state = SpaceState2.READY;
|
|
4438
|
-
|
|
4461
|
+
log15("new state", {
|
|
4439
4462
|
state: SpaceState2[this._state]
|
|
4440
4463
|
}, {
|
|
4441
4464
|
F: __dxlog_file17,
|
|
@@ -4453,7 +4476,7 @@ var DataSpace = class {
|
|
|
4453
4476
|
});
|
|
4454
4477
|
this.metrics.controlPipelineReady = /* @__PURE__ */ new Date();
|
|
4455
4478
|
await this._createWritableFeeds();
|
|
4456
|
-
|
|
4479
|
+
log15("writable feeds created", void 0, {
|
|
4457
4480
|
F: __dxlog_file17,
|
|
4458
4481
|
L: 322,
|
|
4459
4482
|
S: this,
|
|
@@ -4513,7 +4536,7 @@ var DataSpace = class {
|
|
|
4513
4536
|
}
|
|
4514
4537
|
}
|
|
4515
4538
|
_onNewAutomergeRoot(rootUrl) {
|
|
4516
|
-
|
|
4539
|
+
log15("loading automerge root doc for space", {
|
|
4517
4540
|
space: this.key,
|
|
4518
4541
|
rootUrl
|
|
4519
4542
|
}, {
|
|
@@ -4565,7 +4588,7 @@ var DataSpace = class {
|
|
|
4565
4588
|
if (err instanceof ContextDisposedError3) {
|
|
4566
4589
|
return;
|
|
4567
4590
|
}
|
|
4568
|
-
|
|
4591
|
+
log15.warn("error loading automerge root doc", {
|
|
4569
4592
|
space: this.key,
|
|
4570
4593
|
rootUrl,
|
|
4571
4594
|
err
|
|
@@ -4653,7 +4676,7 @@ var DataSpace = class {
|
|
|
4653
4676
|
await this._close();
|
|
4654
4677
|
}
|
|
4655
4678
|
this._state = SpaceState2.INACTIVE;
|
|
4656
|
-
|
|
4679
|
+
log15("new state", {
|
|
4657
4680
|
state: SpaceState2[this._state]
|
|
4658
4681
|
}, {
|
|
4659
4682
|
F: __dxlog_file17,
|
|
@@ -4724,7 +4747,7 @@ import { LEGACY_TYPE_PROPERTIES, SpaceDocVersion as SpaceDocVersion2, encodeRefe
|
|
|
4724
4747
|
import { TYPE_PROPERTIES as TYPE_PROPERTIES2, generateEchoId, getTypeReference } from "@dxos/echo-schema";
|
|
4725
4748
|
import { invariant as invariant14 } from "@dxos/invariant";
|
|
4726
4749
|
import { PublicKey as PublicKey11 } from "@dxos/keys";
|
|
4727
|
-
import { log as
|
|
4750
|
+
import { log as log16 } from "@dxos/log";
|
|
4728
4751
|
import { trace as Trace2 } from "@dxos/protocols";
|
|
4729
4752
|
import { Invitation as Invitation7, SpaceState as SpaceState3 } from "@dxos/protocols/proto/dxos/client/services";
|
|
4730
4753
|
import { SpaceMember as SpaceMember6 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
@@ -4860,13 +4883,13 @@ var DataSpaceManager = class {
|
|
|
4860
4883
|
return this._spaces;
|
|
4861
4884
|
}
|
|
4862
4885
|
async open() {
|
|
4863
|
-
|
|
4886
|
+
log16("open", void 0, {
|
|
4864
4887
|
F: __dxlog_file18,
|
|
4865
4888
|
L: 146,
|
|
4866
4889
|
S: this,
|
|
4867
4890
|
C: (f, a) => f(...a)
|
|
4868
4891
|
});
|
|
4869
|
-
|
|
4892
|
+
log16.trace("dxos.echo.data-space-manager.open", Trace2.begin({
|
|
4870
4893
|
id: this._instanceId
|
|
4871
4894
|
}), {
|
|
4872
4895
|
F: __dxlog_file18,
|
|
@@ -4874,7 +4897,7 @@ var DataSpaceManager = class {
|
|
|
4874
4897
|
S: this,
|
|
4875
4898
|
C: (f, a) => f(...a)
|
|
4876
4899
|
});
|
|
4877
|
-
|
|
4900
|
+
log16("metadata loaded", {
|
|
4878
4901
|
spaces: this._metadataStore.spaces.length
|
|
4879
4902
|
}, {
|
|
4880
4903
|
F: __dxlog_file18,
|
|
@@ -4884,7 +4907,7 @@ var DataSpaceManager = class {
|
|
|
4884
4907
|
});
|
|
4885
4908
|
await forEachAsync(this._metadataStore.spaces, async (spaceMetadata) => {
|
|
4886
4909
|
try {
|
|
4887
|
-
|
|
4910
|
+
log16("load space", {
|
|
4888
4911
|
spaceMetadata
|
|
4889
4912
|
}, {
|
|
4890
4913
|
F: __dxlog_file18,
|
|
@@ -4894,7 +4917,7 @@ var DataSpaceManager = class {
|
|
|
4894
4917
|
});
|
|
4895
4918
|
await this._constructSpace(spaceMetadata);
|
|
4896
4919
|
} catch (err) {
|
|
4897
|
-
|
|
4920
|
+
log16.error("Error loading space", {
|
|
4898
4921
|
spaceMetadata,
|
|
4899
4922
|
err
|
|
4900
4923
|
}, {
|
|
@@ -4907,7 +4930,7 @@ var DataSpaceManager = class {
|
|
|
4907
4930
|
});
|
|
4908
4931
|
this._isOpen = true;
|
|
4909
4932
|
this.updated.emit();
|
|
4910
|
-
|
|
4933
|
+
log16.trace("dxos.echo.data-space-manager.open", Trace2.end({
|
|
4911
4934
|
id: this._instanceId
|
|
4912
4935
|
}), {
|
|
4913
4936
|
F: __dxlog_file18,
|
|
@@ -4917,7 +4940,7 @@ var DataSpaceManager = class {
|
|
|
4917
4940
|
});
|
|
4918
4941
|
}
|
|
4919
4942
|
async close() {
|
|
4920
|
-
|
|
4943
|
+
log16("close", void 0, {
|
|
4921
4944
|
F: __dxlog_file18,
|
|
4922
4945
|
L: 167,
|
|
4923
4946
|
S: this,
|
|
@@ -4953,7 +4976,7 @@ var DataSpaceManager = class {
|
|
|
4953
4976
|
dataFeedKey,
|
|
4954
4977
|
state: SpaceState3.ACTIVE
|
|
4955
4978
|
};
|
|
4956
|
-
|
|
4979
|
+
log16("creating space...", {
|
|
4957
4980
|
spaceKey
|
|
4958
4981
|
}, {
|
|
4959
4982
|
F: __dxlog_file18,
|
|
@@ -4996,7 +5019,7 @@ var DataSpaceManager = class {
|
|
|
4996
5019
|
return properties?.data?.[DEFAULT_SPACE_KEY] === this._signingContext.identityKey.toHex();
|
|
4997
5020
|
}
|
|
4998
5021
|
default:
|
|
4999
|
-
|
|
5022
|
+
log16.warn("unknown space version", {
|
|
5000
5023
|
version: space.databaseRoot.getVersion(),
|
|
5001
5024
|
spaceId: space.id
|
|
5002
5025
|
}, {
|
|
@@ -5049,7 +5072,7 @@ var DataSpaceManager = class {
|
|
|
5049
5072
|
}
|
|
5050
5073
|
// TODO(burdon): Rename join space.
|
|
5051
5074
|
async acceptSpace(opts) {
|
|
5052
|
-
|
|
5075
|
+
log16("accept space", {
|
|
5053
5076
|
opts
|
|
5054
5077
|
}, {
|
|
5055
5078
|
F: __dxlog_file18,
|
|
@@ -5100,7 +5123,7 @@ var DataSpaceManager = class {
|
|
|
5100
5123
|
}));
|
|
5101
5124
|
}
|
|
5102
5125
|
async _constructSpace(metadata) {
|
|
5103
|
-
|
|
5126
|
+
log16("construct space", {
|
|
5104
5127
|
metadata
|
|
5105
5128
|
}, {
|
|
5106
5129
|
F: __dxlog_file18,
|
|
@@ -5140,7 +5163,7 @@ var DataSpaceManager = class {
|
|
|
5140
5163
|
session.addExtension("dxos.mesh.teleport.automerge", this._echoHost.createReplicationExtension());
|
|
5141
5164
|
},
|
|
5142
5165
|
onAuthFailure: () => {
|
|
5143
|
-
|
|
5166
|
+
log16.warn("auth failure", void 0, {
|
|
5144
5167
|
F: __dxlog_file18,
|
|
5145
5168
|
L: 343,
|
|
5146
5169
|
S: this,
|
|
@@ -5171,7 +5194,7 @@ var DataSpaceManager = class {
|
|
|
5171
5194
|
signingContext: this._signingContext,
|
|
5172
5195
|
callbacks: {
|
|
5173
5196
|
beforeReady: async () => {
|
|
5174
|
-
|
|
5197
|
+
log16("before space ready", {
|
|
5175
5198
|
space: space.key
|
|
5176
5199
|
}, {
|
|
5177
5200
|
F: __dxlog_file18,
|
|
@@ -5181,7 +5204,7 @@ var DataSpaceManager = class {
|
|
|
5181
5204
|
});
|
|
5182
5205
|
},
|
|
5183
5206
|
afterReady: async () => {
|
|
5184
|
-
|
|
5207
|
+
log16("after space ready", {
|
|
5185
5208
|
space: space.key,
|
|
5186
5209
|
open: this._isOpen
|
|
5187
5210
|
}, {
|
|
@@ -5201,7 +5224,7 @@ var DataSpaceManager = class {
|
|
|
5201
5224
|
}
|
|
5202
5225
|
},
|
|
5203
5226
|
beforeClose: async () => {
|
|
5204
|
-
|
|
5227
|
+
log16("before space close", {
|
|
5205
5228
|
space: space.key
|
|
5206
5229
|
}, {
|
|
5207
5230
|
F: __dxlog_file18,
|
|
@@ -5236,11 +5259,11 @@ var DataSpaceManager = class {
|
|
|
5236
5259
|
return (s && member.role === SpaceMember6.Role.REMOVED !== (s.authStatus === AuthStatus.FAILURE)) ?? false;
|
|
5237
5260
|
});
|
|
5238
5261
|
sessionsToClose.forEach((session) => {
|
|
5239
|
-
void session.close().catch(
|
|
5262
|
+
void session.close().catch(log16.error);
|
|
5240
5263
|
});
|
|
5241
5264
|
closedSessions += sessionsToClose.length;
|
|
5242
5265
|
}
|
|
5243
|
-
|
|
5266
|
+
log16("processed member role changes", {
|
|
5244
5267
|
roleChangeCount: memberInfo.length,
|
|
5245
5268
|
peersOnline: presence.getPeersOnline().length,
|
|
5246
5269
|
closedSessions
|
|
@@ -5257,7 +5280,7 @@ var DataSpaceManager = class {
|
|
|
5257
5280
|
if (role === SpaceMember6.Role.REMOVED) {
|
|
5258
5281
|
const session = peerState.peerId && space.protocol.sessions.get(peerState.peerId);
|
|
5259
5282
|
if (session != null) {
|
|
5260
|
-
|
|
5283
|
+
log16("closing a session with a removed peer", {
|
|
5261
5284
|
peerId: peerState.peerId
|
|
5262
5285
|
}, {
|
|
5263
5286
|
F: __dxlog_file18,
|
|
@@ -5265,7 +5288,7 @@ var DataSpaceManager = class {
|
|
|
5265
5288
|
S: this,
|
|
5266
5289
|
C: (f, a) => f(...a)
|
|
5267
5290
|
});
|
|
5268
|
-
void session.close().catch(
|
|
5291
|
+
void session.close().catch(log16.error);
|
|
5269
5292
|
}
|
|
5270
5293
|
}
|
|
5271
5294
|
}
|
|
@@ -5328,7 +5351,7 @@ import { createAdmissionCredentials as createAdmissionCredentials2, getCredentia
|
|
|
5328
5351
|
import { raise as raise2 } from "@dxos/debug";
|
|
5329
5352
|
import { writeMessages as writeMessages3 } from "@dxos/feed-store";
|
|
5330
5353
|
import { invariant as invariant15 } from "@dxos/invariant";
|
|
5331
|
-
import { log as
|
|
5354
|
+
import { log as log17 } from "@dxos/log";
|
|
5332
5355
|
import { ApiError, SpaceNotFoundError as SpaceNotFoundError2, encodeError, IdentityNotInitializedError, AuthorizationError as AuthorizationError2 } from "@dxos/protocols";
|
|
5333
5356
|
import { SpaceMember as SpaceMember7, SpaceState as SpaceState4 } from "@dxos/protocols/proto/dxos/client/services";
|
|
5334
5357
|
import { trace as trace8 } from "@dxos/tracing";
|
|
@@ -5401,7 +5424,7 @@ var SpacesServiceImpl = class {
|
|
|
5401
5424
|
const scheduler = new UpdateScheduler(ctx, async () => {
|
|
5402
5425
|
const dataSpaceManager = await this._getDataSpaceManager();
|
|
5403
5426
|
const spaces = Array.from(dataSpaceManager.spaces.values()).map((space) => this._serializeSpace(space));
|
|
5404
|
-
|
|
5427
|
+
log17("update", {
|
|
5405
5428
|
spaces
|
|
5406
5429
|
}, {
|
|
5407
5430
|
F: __dxlog_file19,
|
|
@@ -5599,7 +5622,7 @@ var SpacesServiceImpl = class {
|
|
|
5599
5622
|
var getChannelId = (channel) => `user-channel/${channel}`;
|
|
5600
5623
|
|
|
5601
5624
|
// packages/sdk/client-services/src/packlets/services/service-context.ts
|
|
5602
|
-
import { Trigger as
|
|
5625
|
+
import { Trigger as Trigger8 } from "@dxos/async";
|
|
5603
5626
|
import { Context as Context10, Resource as Resource3 } from "@dxos/context";
|
|
5604
5627
|
import { getCredentialAssertion as getCredentialAssertion5 } from "@dxos/credentials";
|
|
5605
5628
|
import { failUndefined as failUndefined2 } from "@dxos/debug";
|
|
@@ -5609,7 +5632,7 @@ import { FeedFactory, FeedStore } from "@dxos/feed-store";
|
|
|
5609
5632
|
import { invariant as invariant16 } from "@dxos/invariant";
|
|
5610
5633
|
import { Keyring } from "@dxos/keyring";
|
|
5611
5634
|
import { PublicKey as PublicKey12 } from "@dxos/keys";
|
|
5612
|
-
import { log as
|
|
5635
|
+
import { log as log18 } from "@dxos/log";
|
|
5613
5636
|
import { InvalidStorageVersionError, STORAGE_VERSION as STORAGE_VERSION2, trace as trace9 } from "@dxos/protocols";
|
|
5614
5637
|
import { Invitation as Invitation8 } from "@dxos/protocols/proto/dxos/client/services";
|
|
5615
5638
|
import { BlobStore } from "@dxos/teleport-extension-object-sync";
|
|
@@ -5634,7 +5657,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5634
5657
|
this.networkManager = networkManager;
|
|
5635
5658
|
this.signalManager = signalManager;
|
|
5636
5659
|
this._runtimeParams = _runtimeParams;
|
|
5637
|
-
this.initialized = new
|
|
5660
|
+
this.initialized = new Trigger8();
|
|
5638
5661
|
this._handlerFactories = /* @__PURE__ */ new Map();
|
|
5639
5662
|
this._instanceId = PublicKey12.random().toHex();
|
|
5640
5663
|
this.metadataStore = new MetadataStore(storage.createDirectory("metadata"));
|
|
@@ -5668,13 +5691,13 @@ var ServiceContext = class extends Resource3 {
|
|
|
5668
5691
|
}
|
|
5669
5692
|
async _open(ctx) {
|
|
5670
5693
|
await this._checkStorageVersion();
|
|
5671
|
-
|
|
5694
|
+
log18("opening...", void 0, {
|
|
5672
5695
|
F: __dxlog_file20,
|
|
5673
5696
|
L: 149,
|
|
5674
5697
|
S: this,
|
|
5675
5698
|
C: (f, a) => f(...a)
|
|
5676
5699
|
});
|
|
5677
|
-
|
|
5700
|
+
log18.trace("dxos.sdk.service-context.open", trace9.begin({
|
|
5678
5701
|
id: this._instanceId
|
|
5679
5702
|
}), {
|
|
5680
5703
|
F: __dxlog_file20,
|
|
@@ -5692,7 +5715,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5692
5715
|
await this._initialize(ctx);
|
|
5693
5716
|
}
|
|
5694
5717
|
const loadedInvitations = await this.invitationsManager.loadPersistentInvitations();
|
|
5695
|
-
|
|
5718
|
+
log18("loaded persistent invitations", {
|
|
5696
5719
|
count: loadedInvitations.invitations?.length
|
|
5697
5720
|
}, {
|
|
5698
5721
|
F: __dxlog_file20,
|
|
@@ -5700,7 +5723,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5700
5723
|
S: this,
|
|
5701
5724
|
C: (f, a) => f(...a)
|
|
5702
5725
|
});
|
|
5703
|
-
|
|
5726
|
+
log18.trace("dxos.sdk.service-context.open", trace9.end({
|
|
5704
5727
|
id: this._instanceId
|
|
5705
5728
|
}), {
|
|
5706
5729
|
F: __dxlog_file20,
|
|
@@ -5708,7 +5731,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5708
5731
|
S: this,
|
|
5709
5732
|
C: (f, a) => f(...a)
|
|
5710
5733
|
});
|
|
5711
|
-
|
|
5734
|
+
log18("opened", void 0, {
|
|
5712
5735
|
F: __dxlog_file20,
|
|
5713
5736
|
L: 166,
|
|
5714
5737
|
S: this,
|
|
@@ -5716,7 +5739,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5716
5739
|
});
|
|
5717
5740
|
}
|
|
5718
5741
|
async _close(ctx) {
|
|
5719
|
-
|
|
5742
|
+
log18("closing...", void 0, {
|
|
5720
5743
|
F: __dxlog_file20,
|
|
5721
5744
|
L: 170,
|
|
5722
5745
|
S: this,
|
|
@@ -5733,7 +5756,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5733
5756
|
await this.echoHost.close(ctx);
|
|
5734
5757
|
await this.networkManager.close();
|
|
5735
5758
|
await this.signalManager.close();
|
|
5736
|
-
|
|
5759
|
+
log18("closed", void 0, {
|
|
5737
5760
|
F: __dxlog_file20,
|
|
5738
5761
|
L: 182,
|
|
5739
5762
|
S: this,
|
|
@@ -5779,7 +5802,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5779
5802
|
}
|
|
5780
5803
|
// Called when identity is created.
|
|
5781
5804
|
async _initialize(ctx) {
|
|
5782
|
-
|
|
5805
|
+
log18("initializing spaces...", void 0, {
|
|
5783
5806
|
F: __dxlog_file20,
|
|
5784
5807
|
L: 224,
|
|
5785
5808
|
S: this,
|
|
@@ -5824,7 +5847,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5824
5847
|
return;
|
|
5825
5848
|
}
|
|
5826
5849
|
if (!this.dataSpaceManager) {
|
|
5827
|
-
|
|
5850
|
+
log18("dataSpaceManager not initialized yet, ignoring space admission", {
|
|
5828
5851
|
details: assertion
|
|
5829
5852
|
}, {
|
|
5830
5853
|
F: __dxlog_file20,
|
|
@@ -5835,7 +5858,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5835
5858
|
return;
|
|
5836
5859
|
}
|
|
5837
5860
|
if (this.dataSpaceManager.spaces.has(assertion.spaceKey)) {
|
|
5838
|
-
|
|
5861
|
+
log18("space already exists, ignoring space admission", {
|
|
5839
5862
|
details: assertion
|
|
5840
5863
|
}, {
|
|
5841
5864
|
F: __dxlog_file20,
|
|
@@ -5846,7 +5869,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5846
5869
|
return;
|
|
5847
5870
|
}
|
|
5848
5871
|
try {
|
|
5849
|
-
|
|
5872
|
+
log18("accepting space recorded in halo", {
|
|
5850
5873
|
details: assertion
|
|
5851
5874
|
}, {
|
|
5852
5875
|
F: __dxlog_file20,
|
|
@@ -5859,7 +5882,7 @@ var ServiceContext = class extends Resource3 {
|
|
|
5859
5882
|
genesisFeedKey: assertion.genesisFeedKey
|
|
5860
5883
|
});
|
|
5861
5884
|
} catch (err) {
|
|
5862
|
-
|
|
5885
|
+
log18.catch(err, void 0, {
|
|
5863
5886
|
F: __dxlog_file20,
|
|
5864
5887
|
L: 280,
|
|
5865
5888
|
S: this,
|
|
@@ -5907,9 +5930,9 @@ var ServiceRegistry = class {
|
|
|
5907
5930
|
};
|
|
5908
5931
|
|
|
5909
5932
|
// packages/sdk/client-services/src/packlets/locks/browser.ts
|
|
5910
|
-
import { asyncTimeout as asyncTimeout3, Trigger as
|
|
5933
|
+
import { asyncTimeout as asyncTimeout3, Trigger as Trigger9 } from "@dxos/async";
|
|
5911
5934
|
import { RESOURCE_LOCK_TIMEOUT } from "@dxos/client-protocol";
|
|
5912
|
-
import { log as
|
|
5935
|
+
import { log as log19, logInfo } from "@dxos/log";
|
|
5913
5936
|
function _ts_decorate7(decorators, target, key, desc) {
|
|
5914
5937
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5915
5938
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -5928,7 +5951,7 @@ var Message;
|
|
|
5928
5951
|
var Lock = class {
|
|
5929
5952
|
constructor({ lockKey, onAcquire, onRelease }) {
|
|
5930
5953
|
this._broadcastChannel = new BroadcastChannel("vault-resource-lock");
|
|
5931
|
-
this._releaseTrigger = new
|
|
5954
|
+
this._releaseTrigger = new Trigger9();
|
|
5932
5955
|
this._lockKey = lockKey;
|
|
5933
5956
|
this._onAcquire = onAcquire;
|
|
5934
5957
|
this._onRelease = onRelease;
|
|
@@ -5942,28 +5965,28 @@ var Lock = class {
|
|
|
5942
5965
|
message: "acquiring"
|
|
5943
5966
|
});
|
|
5944
5967
|
try {
|
|
5945
|
-
|
|
5968
|
+
log19("aquiring lock...", void 0, {
|
|
5946
5969
|
F: __dxlog_file21,
|
|
5947
5970
|
L: 42,
|
|
5948
5971
|
S: this,
|
|
5949
5972
|
C: (f, a) => f(...a)
|
|
5950
5973
|
});
|
|
5951
5974
|
await asyncTimeout3(this._requestLock(), RESOURCE_LOCK_TIMEOUT);
|
|
5952
|
-
|
|
5975
|
+
log19("acquired lock", void 0, {
|
|
5953
5976
|
F: __dxlog_file21,
|
|
5954
5977
|
L: 44,
|
|
5955
5978
|
S: this,
|
|
5956
5979
|
C: (f, a) => f(...a)
|
|
5957
5980
|
});
|
|
5958
5981
|
} catch {
|
|
5959
|
-
|
|
5982
|
+
log19("stealing lock...", void 0, {
|
|
5960
5983
|
F: __dxlog_file21,
|
|
5961
5984
|
L: 46,
|
|
5962
5985
|
S: this,
|
|
5963
5986
|
C: (f, a) => f(...a)
|
|
5964
5987
|
});
|
|
5965
5988
|
await this._requestLock(true);
|
|
5966
|
-
|
|
5989
|
+
log19("stolen lock", void 0, {
|
|
5967
5990
|
F: __dxlog_file21,
|
|
5968
5991
|
L: 48,
|
|
5969
5992
|
S: this,
|
|
@@ -5980,7 +6003,7 @@ var Lock = class {
|
|
|
5980
6003
|
}
|
|
5981
6004
|
}
|
|
5982
6005
|
async _requestLock(steal = false) {
|
|
5983
|
-
|
|
6006
|
+
log19("requesting lock...", {
|
|
5984
6007
|
steal
|
|
5985
6008
|
}, {
|
|
5986
6009
|
F: __dxlog_file21,
|
|
@@ -5988,22 +6011,22 @@ var Lock = class {
|
|
|
5988
6011
|
S: this,
|
|
5989
6012
|
C: (f, a) => f(...a)
|
|
5990
6013
|
});
|
|
5991
|
-
const acquired = new
|
|
6014
|
+
const acquired = new Trigger9();
|
|
5992
6015
|
void navigator.locks.request(this._lockKey, {
|
|
5993
6016
|
steal
|
|
5994
6017
|
}, async () => {
|
|
5995
6018
|
await this._onAcquire?.();
|
|
5996
6019
|
acquired.wake();
|
|
5997
|
-
this._releaseTrigger = new
|
|
6020
|
+
this._releaseTrigger = new Trigger9();
|
|
5998
6021
|
await this._releaseTrigger.wait();
|
|
5999
|
-
|
|
6022
|
+
log19("releasing lock...", void 0, {
|
|
6000
6023
|
F: __dxlog_file21,
|
|
6001
6024
|
L: 72,
|
|
6002
6025
|
S: this,
|
|
6003
6026
|
C: (f, a) => f(...a)
|
|
6004
6027
|
});
|
|
6005
6028
|
await this._onRelease?.();
|
|
6006
|
-
|
|
6029
|
+
log19("released lock", void 0, {
|
|
6007
6030
|
F: __dxlog_file21,
|
|
6008
6031
|
L: 74,
|
|
6009
6032
|
S: this,
|
|
@@ -6013,7 +6036,7 @@ var Lock = class {
|
|
|
6013
6036
|
await this._onRelease?.();
|
|
6014
6037
|
});
|
|
6015
6038
|
await acquired.wait();
|
|
6016
|
-
|
|
6039
|
+
log19("recieved lock", {
|
|
6017
6040
|
steal
|
|
6018
6041
|
}, {
|
|
6019
6042
|
F: __dxlog_file21,
|
|
@@ -6110,7 +6133,7 @@ import { clientServiceBundle } from "@dxos/client-protocol";
|
|
|
6110
6133
|
import { Context as Context11 } from "@dxos/context";
|
|
6111
6134
|
import { invariant as invariant18 } from "@dxos/invariant";
|
|
6112
6135
|
import { PublicKey as PublicKey16 } from "@dxos/keys";
|
|
6113
|
-
import { log as
|
|
6136
|
+
import { log as log21 } from "@dxos/log";
|
|
6114
6137
|
import { WebsocketSignalManager } from "@dxos/messaging";
|
|
6115
6138
|
import { SwarmNetworkManager, createSimplePeerTransportFactory } from "@dxos/network-manager";
|
|
6116
6139
|
import { trace as trace10 } from "@dxos/protocols";
|
|
@@ -6251,7 +6274,7 @@ var findConfigs = () => {
|
|
|
6251
6274
|
import { Event as Event8 } from "@dxos/async";
|
|
6252
6275
|
import { Stream as Stream12 } from "@dxos/codec-protobuf";
|
|
6253
6276
|
import { PublicKey as PublicKey15 } from "@dxos/keys";
|
|
6254
|
-
import { getContextFromEntry, log as
|
|
6277
|
+
import { getContextFromEntry, log as log20 } from "@dxos/log";
|
|
6255
6278
|
import { QueryLogsRequest } from "@dxos/protocols/proto/dxos/client/services";
|
|
6256
6279
|
import { getDebugName, jsonify, numericalValues, tracer } from "@dxos/util";
|
|
6257
6280
|
var LoggingServiceImpl = class {
|
|
@@ -6264,11 +6287,11 @@ var LoggingServiceImpl = class {
|
|
|
6264
6287
|
};
|
|
6265
6288
|
}
|
|
6266
6289
|
async open() {
|
|
6267
|
-
|
|
6290
|
+
log20.runtimeConfig.processors.push(this._logProcessor);
|
|
6268
6291
|
}
|
|
6269
6292
|
async close() {
|
|
6270
|
-
const index =
|
|
6271
|
-
|
|
6293
|
+
const index = log20.runtimeConfig.processors.findIndex((processor) => processor === this._logProcessor);
|
|
6294
|
+
log20.runtimeConfig.processors.splice(index, 1);
|
|
6272
6295
|
}
|
|
6273
6296
|
async controlMetrics({ reset, record }) {
|
|
6274
6297
|
if (reset) {
|
|
@@ -6569,7 +6592,7 @@ var ClientServicesHost = class {
|
|
|
6569
6592
|
"'service host is open'"
|
|
6570
6593
|
]
|
|
6571
6594
|
});
|
|
6572
|
-
|
|
6595
|
+
log21("initializing...", void 0, {
|
|
6573
6596
|
F: __dxlog_file23,
|
|
6574
6597
|
L: 187,
|
|
6575
6598
|
S: this,
|
|
@@ -6591,7 +6614,7 @@ var ClientServicesHost = class {
|
|
|
6591
6614
|
}
|
|
6592
6615
|
}
|
|
6593
6616
|
if (!options.signalManager) {
|
|
6594
|
-
|
|
6617
|
+
log21.warn("running signaling without telemetry metadata.", void 0, {
|
|
6595
6618
|
F: __dxlog_file23,
|
|
6596
6619
|
L: 198,
|
|
6597
6620
|
S: this,
|
|
@@ -6616,7 +6639,7 @@ var ClientServicesHost = class {
|
|
|
6616
6639
|
transportFactory,
|
|
6617
6640
|
signalManager
|
|
6618
6641
|
});
|
|
6619
|
-
|
|
6642
|
+
log21("initialized", void 0, {
|
|
6620
6643
|
F: __dxlog_file23,
|
|
6621
6644
|
L: 216,
|
|
6622
6645
|
S: this,
|
|
@@ -6628,7 +6651,7 @@ var ClientServicesHost = class {
|
|
|
6628
6651
|
return;
|
|
6629
6652
|
}
|
|
6630
6653
|
const traceId = PublicKey16.random().toHex();
|
|
6631
|
-
|
|
6654
|
+
log21.trace("dxos.client-services.host.open", trace10.begin({
|
|
6632
6655
|
id: traceId
|
|
6633
6656
|
}), {
|
|
6634
6657
|
F: __dxlog_file23,
|
|
@@ -6673,7 +6696,7 @@ var ClientServicesHost = class {
|
|
|
6673
6696
|
]
|
|
6674
6697
|
});
|
|
6675
6698
|
this._opening = true;
|
|
6676
|
-
|
|
6699
|
+
log21("opening...", {
|
|
6677
6700
|
lockKey: this._resourceLock?.lockKey
|
|
6678
6701
|
}, {
|
|
6679
6702
|
F: __dxlog_file23,
|
|
@@ -6727,7 +6750,7 @@ var ClientServicesHost = class {
|
|
|
6727
6750
|
this._open = true;
|
|
6728
6751
|
this._statusUpdate.emit();
|
|
6729
6752
|
const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
|
|
6730
|
-
|
|
6753
|
+
log21("opened", {
|
|
6731
6754
|
deviceKey
|
|
6732
6755
|
}, {
|
|
6733
6756
|
F: __dxlog_file23,
|
|
@@ -6735,7 +6758,7 @@ var ClientServicesHost = class {
|
|
|
6735
6758
|
S: this,
|
|
6736
6759
|
C: (f, a) => f(...a)
|
|
6737
6760
|
});
|
|
6738
|
-
|
|
6761
|
+
log21.trace("dxos.client-services.host.open", trace10.end({
|
|
6739
6762
|
id: traceId
|
|
6740
6763
|
}), {
|
|
6741
6764
|
F: __dxlog_file23,
|
|
@@ -6749,7 +6772,7 @@ var ClientServicesHost = class {
|
|
|
6749
6772
|
return;
|
|
6750
6773
|
}
|
|
6751
6774
|
const deviceKey = this._serviceContext.identityManager.identity?.deviceKey;
|
|
6752
|
-
|
|
6775
|
+
log21("closing...", {
|
|
6753
6776
|
deviceKey
|
|
6754
6777
|
}, {
|
|
6755
6778
|
F: __dxlog_file23,
|
|
@@ -6767,7 +6790,7 @@ var ClientServicesHost = class {
|
|
|
6767
6790
|
await this._level?.close();
|
|
6768
6791
|
this._open = false;
|
|
6769
6792
|
this._statusUpdate.emit();
|
|
6770
|
-
|
|
6793
|
+
log21("closed", {
|
|
6771
6794
|
deviceKey
|
|
6772
6795
|
}, {
|
|
6773
6796
|
F: __dxlog_file23,
|
|
@@ -6778,7 +6801,7 @@ var ClientServicesHost = class {
|
|
|
6778
6801
|
}
|
|
6779
6802
|
async reset() {
|
|
6780
6803
|
const traceId = PublicKey16.random().toHex();
|
|
6781
|
-
|
|
6804
|
+
log21.trace("dxos.sdk.client-services-host.reset", trace10.begin({
|
|
6782
6805
|
id: traceId
|
|
6783
6806
|
}), {
|
|
6784
6807
|
F: __dxlog_file23,
|
|
@@ -6786,7 +6809,7 @@ var ClientServicesHost = class {
|
|
|
6786
6809
|
S: this,
|
|
6787
6810
|
C: (f, a) => f(...a)
|
|
6788
6811
|
});
|
|
6789
|
-
|
|
6812
|
+
log21.info("resetting...", void 0, {
|
|
6790
6813
|
F: __dxlog_file23,
|
|
6791
6814
|
L: 342,
|
|
6792
6815
|
S: this,
|
|
@@ -6794,13 +6817,13 @@ var ClientServicesHost = class {
|
|
|
6794
6817
|
});
|
|
6795
6818
|
await this._serviceContext?.close();
|
|
6796
6819
|
await this._storage.reset();
|
|
6797
|
-
|
|
6820
|
+
log21.info("reset", void 0, {
|
|
6798
6821
|
F: __dxlog_file23,
|
|
6799
6822
|
L: 345,
|
|
6800
6823
|
S: this,
|
|
6801
6824
|
C: (f, a) => f(...a)
|
|
6802
6825
|
});
|
|
6803
|
-
|
|
6826
|
+
log21.trace("dxos.sdk.client-services-host.reset", trace10.end({
|
|
6804
6827
|
id: traceId
|
|
6805
6828
|
}), {
|
|
6806
6829
|
F: __dxlog_file23,
|
|
@@ -6874,4 +6897,4 @@ export {
|
|
|
6874
6897
|
ClientServicesProviderResource,
|
|
6875
6898
|
DiagnosticsCollector
|
|
6876
6899
|
};
|
|
6877
|
-
//# sourceMappingURL=chunk-
|
|
6900
|
+
//# sourceMappingURL=chunk-S5DPO2DT.mjs.map
|