@dxos/echo-pipeline 0.4.7 → 0.4.8-main.0602afb
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-UIMWNUNO.mjs → chunk-XR2636AC.mjs} +86 -50
- package/dist/lib/browser/chunk-XR2636AC.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +4 -4
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/node/{chunk-Z3IT3GUD.cjs → chunk-LD4R726W.cjs} +100 -63
- package/dist/lib/node/chunk-LD4R726W.cjs.map +7 -0
- package/dist/lib/node/index.cjs +31 -29
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +19 -19
- package/dist/lib/node/testing/index.cjs.map +2 -2
- package/dist/types/src/automerge/automerge-host.d.ts +2 -1
- package/dist/types/src/automerge/automerge-host.d.ts.map +1 -1
- package/dist/types/src/automerge/automerge-storage-adapter.d.ts +2 -2
- package/dist/types/src/automerge/automerge-storage-adapter.d.ts.map +1 -1
- package/dist/types/src/metadata/metadata-store.d.ts +6 -2
- package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
- package/dist/types/src/testing/database-test-rig.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/automerge/automerge-host.ts +25 -23
- package/src/automerge/automerge-storage-adapter.ts +8 -10
- package/src/metadata/metadata-store.ts +46 -3
- package/src/testing/database-test-rig.ts +2 -0
- package/dist/lib/browser/chunk-UIMWNUNO.mjs.map +0 -7
- package/dist/lib/node/chunk-Z3IT3GUD.cjs.map +0 -7
- package/dist/types/src/tests/database-unit.test.d.ts +0 -2
- package/dist/types/src/tests/database-unit.test.d.ts.map +0 -1
- package/src/tests/database-unit.test.ts +0 -325
|
@@ -491,7 +491,8 @@ var DataServiceImpl = class {
|
|
|
491
491
|
|
|
492
492
|
// packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts
|
|
493
493
|
import CRC32 from "crc-32";
|
|
494
|
-
import {
|
|
494
|
+
import { Event, scheduleTaskInterval, synchronized } from "@dxos/async";
|
|
495
|
+
import { Context as Context2 } from "@dxos/context";
|
|
495
496
|
import { invariant as invariant4 } from "@dxos/invariant";
|
|
496
497
|
import { PublicKey as PublicKey3 } from "@dxos/keys";
|
|
497
498
|
import { log as log3 } from "@dxos/log";
|
|
@@ -509,6 +510,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
509
510
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
510
511
|
}
|
|
511
512
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts";
|
|
513
|
+
var EXPIRED_INVITATION_CLEANUP_INTERVAL = 60 * 60 * 1e3;
|
|
512
514
|
var emptyEchoMetadata = () => ({
|
|
513
515
|
version: STORAGE_VERSION,
|
|
514
516
|
spaces: [],
|
|
@@ -524,6 +526,7 @@ var MetadataStore = class {
|
|
|
524
526
|
this._spaceLargeMetadata = new ComplexMap3(PublicKey3.hash);
|
|
525
527
|
this._metadataFile = void 0;
|
|
526
528
|
this.update = new Event();
|
|
529
|
+
this._invitationCleanupCtx = new Context2();
|
|
527
530
|
this._directory = directory;
|
|
528
531
|
}
|
|
529
532
|
get metadata() {
|
|
@@ -553,7 +556,7 @@ var MetadataStore = class {
|
|
|
553
556
|
name: file.filename
|
|
554
557
|
}, {
|
|
555
558
|
F: __dxlog_file4,
|
|
556
|
-
L:
|
|
559
|
+
L: 89,
|
|
557
560
|
S: this,
|
|
558
561
|
C: (f, a) => f(...a)
|
|
559
562
|
});
|
|
@@ -589,12 +592,13 @@ var MetadataStore = class {
|
|
|
589
592
|
checksum
|
|
590
593
|
}, {
|
|
591
594
|
F: __dxlog_file4,
|
|
592
|
-
L:
|
|
595
|
+
L: 124,
|
|
593
596
|
S: this,
|
|
594
597
|
C: (f, a) => f(...a)
|
|
595
598
|
});
|
|
596
599
|
}
|
|
597
600
|
async close() {
|
|
601
|
+
await this._invitationCleanupCtx.dispose();
|
|
598
602
|
await this.flush();
|
|
599
603
|
await this._metadataFile?.close();
|
|
600
604
|
this._metadataFile = void 0;
|
|
@@ -621,7 +625,7 @@ var MetadataStore = class {
|
|
|
621
625
|
err
|
|
622
626
|
}, {
|
|
623
627
|
F: __dxlog_file4,
|
|
624
|
-
L:
|
|
628
|
+
L: 156,
|
|
625
629
|
S: this,
|
|
626
630
|
C: (f, a) => f(...a)
|
|
627
631
|
});
|
|
@@ -638,12 +642,19 @@ var MetadataStore = class {
|
|
|
638
642
|
err
|
|
639
643
|
}, {
|
|
640
644
|
F: __dxlog_file4,
|
|
641
|
-
L:
|
|
645
|
+
L: 168,
|
|
642
646
|
S: this,
|
|
643
647
|
C: (f, a) => f(...a)
|
|
644
648
|
});
|
|
645
649
|
}
|
|
646
650
|
});
|
|
651
|
+
scheduleTaskInterval(this._invitationCleanupCtx, async () => {
|
|
652
|
+
for (const invitation of this.getInvitations()) {
|
|
653
|
+
if (invitation.created && invitation.lifetime && invitation.lifetime !== 0 && invitation.created.getTime() + invitation.lifetime * 1e3 < Date.now()) {
|
|
654
|
+
await this.removeInvitation(invitation.invitationId);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}, EXPIRED_INVITATION_CLEANUP_INTERVAL);
|
|
647
658
|
}
|
|
648
659
|
async _save() {
|
|
649
660
|
const data = {
|
|
@@ -668,7 +679,7 @@ var MetadataStore = class {
|
|
|
668
679
|
err
|
|
669
680
|
}, {
|
|
670
681
|
F: __dxlog_file4,
|
|
671
|
-
L:
|
|
682
|
+
L: 215,
|
|
672
683
|
S: this,
|
|
673
684
|
C: (f, a) => f(...a)
|
|
674
685
|
});
|
|
@@ -689,7 +700,7 @@ var MetadataStore = class {
|
|
|
689
700
|
const space = this.spaces.find((space2) => space2.key === spaceKey);
|
|
690
701
|
invariant4(space, "Space not found", {
|
|
691
702
|
F: __dxlog_file4,
|
|
692
|
-
L:
|
|
703
|
+
L: 237,
|
|
693
704
|
S: this,
|
|
694
705
|
A: [
|
|
695
706
|
"space",
|
|
@@ -713,7 +724,7 @@ var MetadataStore = class {
|
|
|
713
724
|
async clear() {
|
|
714
725
|
log3("clearing all metadata", void 0, {
|
|
715
726
|
F: __dxlog_file4,
|
|
716
|
-
L:
|
|
727
|
+
L: 256,
|
|
717
728
|
S: this,
|
|
718
729
|
C: (f, a) => f(...a)
|
|
719
730
|
});
|
|
@@ -726,7 +737,7 @@ var MetadataStore = class {
|
|
|
726
737
|
async setIdentityRecord(record) {
|
|
727
738
|
invariant4(!this._metadata.identity, "Cannot overwrite existing identity in metadata", {
|
|
728
739
|
F: __dxlog_file4,
|
|
729
|
-
L:
|
|
740
|
+
L: 266,
|
|
730
741
|
S: this,
|
|
731
742
|
A: [
|
|
732
743
|
"!this._metadata.identity",
|
|
@@ -737,10 +748,26 @@ var MetadataStore = class {
|
|
|
737
748
|
await this._save();
|
|
738
749
|
await this.flush();
|
|
739
750
|
}
|
|
751
|
+
getInvitations() {
|
|
752
|
+
return this._metadata.invitations ?? [];
|
|
753
|
+
}
|
|
754
|
+
async addInvitation(invitation) {
|
|
755
|
+
if (this._metadata.invitations?.find((i) => i.invitationId === invitation.invitationId)) {
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
(this._metadata.invitations ??= []).push(invitation);
|
|
759
|
+
await this._save();
|
|
760
|
+
await this.flush();
|
|
761
|
+
}
|
|
762
|
+
async removeInvitation(invitationId) {
|
|
763
|
+
this._metadata.invitations = (this._metadata.invitations ?? []).filter((i) => i.invitationId !== invitationId);
|
|
764
|
+
await this._save();
|
|
765
|
+
await this.flush();
|
|
766
|
+
}
|
|
740
767
|
async addSpace(record) {
|
|
741
768
|
invariant4(!(this._metadata.spaces ?? []).find((space) => space.key === record.key), "Cannot overwrite existing space in metadata", {
|
|
742
769
|
F: __dxlog_file4,
|
|
743
|
-
L:
|
|
770
|
+
L: 294,
|
|
744
771
|
S: this,
|
|
745
772
|
A: [
|
|
746
773
|
"!(this._metadata.spaces ?? []).find((space) => space.key === record.key)",
|
|
@@ -895,7 +922,7 @@ _ts_decorate2([
|
|
|
895
922
|
|
|
896
923
|
// packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts
|
|
897
924
|
import { Event as Event3, sleepWithContext, synchronized as synchronized2, Trigger } from "@dxos/async";
|
|
898
|
-
import { Context as
|
|
925
|
+
import { Context as Context3, rejectOnDispose } from "@dxos/context";
|
|
899
926
|
import { failUndefined } from "@dxos/debug";
|
|
900
927
|
import { FeedSetIterator } from "@dxos/feed-store";
|
|
901
928
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
@@ -950,7 +977,7 @@ var PipelineState = class {
|
|
|
950
977
|
constructor(_feeds, _timeframeClock) {
|
|
951
978
|
this._feeds = _feeds;
|
|
952
979
|
this._timeframeClock = _timeframeClock;
|
|
953
|
-
this._ctx = new
|
|
980
|
+
this._ctx = new Context3();
|
|
954
981
|
this.timeframeUpdate = this._timeframeClock.update;
|
|
955
982
|
this.stalled = new Event3();
|
|
956
983
|
this._startTimeframe = new Timeframe2();
|
|
@@ -998,7 +1025,7 @@ var PipelineState = class {
|
|
|
998
1025
|
*
|
|
999
1026
|
* @param timeout Timeout in milliseconds to specify the maximum wait time.
|
|
1000
1027
|
*/
|
|
1001
|
-
async waitUntilReachedTargetTimeframe({ ctx = new
|
|
1028
|
+
async waitUntilReachedTargetTimeframe({ ctx = new Context3(), timeout, breakOnStall = true } = {}) {
|
|
1002
1029
|
log6("waitUntilReachedTargetTimeframe", {
|
|
1003
1030
|
timeout,
|
|
1004
1031
|
current: this.timeframe,
|
|
@@ -1166,7 +1193,7 @@ var Pipeline = class {
|
|
|
1166
1193
|
await this._feedSetIterator?.close();
|
|
1167
1194
|
await this._processingTrigger.wait();
|
|
1168
1195
|
await this._state._ctx.dispose();
|
|
1169
|
-
this._state._ctx = new
|
|
1196
|
+
this._state._ctx = new Context3();
|
|
1170
1197
|
this._state._reachedTargetPromise = void 0;
|
|
1171
1198
|
this._state._reachedTarget = false;
|
|
1172
1199
|
this._isStarted = false;
|
|
@@ -1351,7 +1378,7 @@ _ts_decorate3([
|
|
|
1351
1378
|
|
|
1352
1379
|
// packages/core/echo/echo-pipeline/src/space/auth.ts
|
|
1353
1380
|
import { runInContext, scheduleTask } from "@dxos/async";
|
|
1354
|
-
import { Context as
|
|
1381
|
+
import { Context as Context4 } from "@dxos/context";
|
|
1355
1382
|
import { randomBytes } from "@dxos/crypto";
|
|
1356
1383
|
import { invariant as invariant7 } from "@dxos/invariant";
|
|
1357
1384
|
import { log as log7 } from "@dxos/log";
|
|
@@ -1370,7 +1397,7 @@ var AuthExtension = class extends RpcExtension {
|
|
|
1370
1397
|
timeout: 60 * 1e3
|
|
1371
1398
|
});
|
|
1372
1399
|
this._authParams = _authParams;
|
|
1373
|
-
this._ctx = new
|
|
1400
|
+
this._ctx = new Context4({
|
|
1374
1401
|
onError: (err) => {
|
|
1375
1402
|
log7.catch(err, void 0, {
|
|
1376
1403
|
F: __dxlog_file8,
|
|
@@ -1458,7 +1485,7 @@ var AuthExtension = class extends RpcExtension {
|
|
|
1458
1485
|
|
|
1459
1486
|
// packages/core/echo/echo-pipeline/src/space/data-pipeline.ts
|
|
1460
1487
|
import { Event as Event4, scheduleTask as scheduleTask2, sleep, synchronized as synchronized3, trackLeaks } from "@dxos/async";
|
|
1461
|
-
import { Context as
|
|
1488
|
+
import { Context as Context5 } from "@dxos/context";
|
|
1462
1489
|
import { checkCredentialType } from "@dxos/credentials";
|
|
1463
1490
|
import { getStateMachineFromItem, ItemManager, TYPE_PROPERTIES } from "@dxos/echo-db";
|
|
1464
1491
|
import { invariant as invariant8 } from "@dxos/invariant";
|
|
@@ -1484,7 +1511,7 @@ var TIMEFRAME_SAVE_DEBOUNCE_INTERVAL = 5e3;
|
|
|
1484
1511
|
var DataPipeline = class {
|
|
1485
1512
|
constructor(_params) {
|
|
1486
1513
|
this._params = _params;
|
|
1487
|
-
this._ctx = new
|
|
1514
|
+
this._ctx = new Context5();
|
|
1488
1515
|
this._pipeline = void 0;
|
|
1489
1516
|
this._targetTimeframe = void 0;
|
|
1490
1517
|
this._lastAutomaticSnapshotTimeframe = new Timeframe3();
|
|
@@ -1592,7 +1619,7 @@ var DataPipeline = class {
|
|
|
1592
1619
|
}
|
|
1593
1620
|
await this.databaseHost?.close();
|
|
1594
1621
|
await this.itemManager?.destroy();
|
|
1595
|
-
this._ctx = new
|
|
1622
|
+
this._ctx = new Context5();
|
|
1596
1623
|
this._pipeline = void 0;
|
|
1597
1624
|
this._targetTimeframe = void 0;
|
|
1598
1625
|
this._lastAutomaticSnapshotTimeframe = new Timeframe3();
|
|
@@ -1739,7 +1766,7 @@ var DataPipeline = class {
|
|
|
1739
1766
|
return;
|
|
1740
1767
|
}
|
|
1741
1768
|
await this._epochCtx?.dispose();
|
|
1742
|
-
const ctx = new
|
|
1769
|
+
const ctx = new Context5({
|
|
1743
1770
|
onError: (err) => {
|
|
1744
1771
|
if (err instanceof CancelledError) {
|
|
1745
1772
|
log8("Epoch processing cancelled.", void 0, {
|
|
@@ -1934,7 +1961,7 @@ import { Callback as Callback2 } from "@dxos/util";
|
|
|
1934
1961
|
|
|
1935
1962
|
// packages/core/echo/echo-pipeline/src/space/control-pipeline.ts
|
|
1936
1963
|
import { DeferredTask, sleepWithContext as sleepWithContext2, trackLeaks as trackLeaks2 } from "@dxos/async";
|
|
1937
|
-
import { Context as
|
|
1964
|
+
import { Context as Context6 } from "@dxos/context";
|
|
1938
1965
|
import { SpaceStateMachine } from "@dxos/credentials";
|
|
1939
1966
|
import { PublicKey as PublicKey5 } from "@dxos/keys";
|
|
1940
1967
|
import { log as log9 } from "@dxos/log";
|
|
@@ -1958,7 +1985,7 @@ var CONTROL_PIPELINE_SNAPSHOT_DELAY = 1e4;
|
|
|
1958
1985
|
var USE_SNAPSHOTS = true;
|
|
1959
1986
|
var ControlPipeline = class {
|
|
1960
1987
|
constructor({ spaceKey, genesisFeed, feedProvider, metadataStore }) {
|
|
1961
|
-
this._ctx = new
|
|
1988
|
+
this._ctx = new Context6();
|
|
1962
1989
|
this._lastTimeframeSaveTime = Date.now();
|
|
1963
1990
|
this.onFeedAdmitted = new Callback();
|
|
1964
1991
|
this._usage = new TimeUsageCounter2();
|
|
@@ -2033,7 +2060,7 @@ var ControlPipeline = class {
|
|
|
2033
2060
|
C: (f, a) => f(...a)
|
|
2034
2061
|
});
|
|
2035
2062
|
setTimeout(async () => {
|
|
2036
|
-
void this._consumePipeline(new
|
|
2063
|
+
void this._consumePipeline(new Context6());
|
|
2037
2064
|
});
|
|
2038
2065
|
await this._pipeline.start();
|
|
2039
2066
|
log9("started", void 0, {
|
|
@@ -2766,11 +2793,9 @@ SpaceManager = _ts_decorate8([
|
|
|
2766
2793
|
], SpaceManager);
|
|
2767
2794
|
|
|
2768
2795
|
// packages/core/echo/echo-pipeline/src/automerge/automerge-storage-adapter.ts
|
|
2769
|
-
import { StorageAdapter } from "@dxos/automerge/automerge-repo";
|
|
2770
2796
|
import { arrayToBuffer as arrayToBuffer2, bufferToArray } from "@dxos/util";
|
|
2771
|
-
var AutomergeStorageAdapter = class
|
|
2797
|
+
var AutomergeStorageAdapter = class {
|
|
2772
2798
|
constructor(_directory) {
|
|
2773
|
-
super();
|
|
2774
2799
|
this._directory = _directory;
|
|
2775
2800
|
this._state = "opened";
|
|
2776
2801
|
}
|
|
@@ -3079,7 +3104,7 @@ var MeshNetworkAdapter = class extends NetworkAdapter2 {
|
|
|
3079
3104
|
import { next as automerge, getHeads } from "@dxos/automerge/automerge";
|
|
3080
3105
|
import { Repo } from "@dxos/automerge/automerge-repo";
|
|
3081
3106
|
import { IndexedDBStorageAdapter } from "@dxos/automerge/automerge-repo-storage-indexeddb";
|
|
3082
|
-
import { Context as
|
|
3107
|
+
import { Context as Context7 } from "@dxos/context";
|
|
3083
3108
|
import { PublicKey as PublicKey8 } from "@dxos/keys";
|
|
3084
3109
|
import { log as log15 } from "@dxos/log";
|
|
3085
3110
|
import { idCodec } from "@dxos/protocols";
|
|
@@ -3131,7 +3156,7 @@ function _ts_decorate9(decorators, target, key, desc) {
|
|
|
3131
3156
|
var __dxlog_file16 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/automerge/automerge-host.ts";
|
|
3132
3157
|
var AutomergeHost = class {
|
|
3133
3158
|
constructor({ directory, metadata }) {
|
|
3134
|
-
this._ctx = new
|
|
3159
|
+
this._ctx = new Context7();
|
|
3135
3160
|
/**
|
|
3136
3161
|
* spaceKey -> deviceKey[]
|
|
3137
3162
|
*/
|
|
@@ -3162,7 +3187,7 @@ var AutomergeHost = class {
|
|
|
3162
3187
|
// Hosts, running in the worker, don't share documents unless requested by other peers.
|
|
3163
3188
|
sharePolicy: async (peerId, documentId) => {
|
|
3164
3189
|
if (peerId.startsWith("client-")) {
|
|
3165
|
-
return
|
|
3190
|
+
return false;
|
|
3166
3191
|
}
|
|
3167
3192
|
if (!documentId) {
|
|
3168
3193
|
return false;
|
|
@@ -3183,21 +3208,20 @@ var AutomergeHost = class {
|
|
|
3183
3208
|
return isRequested;
|
|
3184
3209
|
}
|
|
3185
3210
|
try {
|
|
3186
|
-
const
|
|
3187
|
-
if (!
|
|
3211
|
+
const spaceKey = getSpaceKeyFromDoc(doc);
|
|
3212
|
+
if (!spaceKey) {
|
|
3188
3213
|
log15("space key not found for share policy check", {
|
|
3189
3214
|
peerId,
|
|
3190
3215
|
documentId
|
|
3191
3216
|
}, {
|
|
3192
3217
|
F: __dxlog_file16,
|
|
3193
|
-
L:
|
|
3218
|
+
L: 103,
|
|
3194
3219
|
S: this,
|
|
3195
3220
|
C: (f, a) => f(...a)
|
|
3196
3221
|
});
|
|
3197
3222
|
return false;
|
|
3198
3223
|
}
|
|
3199
|
-
const
|
|
3200
|
-
const authorizedDevices = this._authorizedDevices.get(spaceKey);
|
|
3224
|
+
const authorizedDevices = this._authorizedDevices.get(PublicKey8.from(spaceKey));
|
|
3201
3225
|
const deviceKeyHex = this.repo.peerMetadataByPeerId[peerId]?.dxos_deviceKey;
|
|
3202
3226
|
if (!deviceKeyHex) {
|
|
3203
3227
|
log15("device key not found for share policy check", {
|
|
@@ -3205,7 +3229,7 @@ var AutomergeHost = class {
|
|
|
3205
3229
|
documentId
|
|
3206
3230
|
}, {
|
|
3207
3231
|
F: __dxlog_file16,
|
|
3208
|
-
L:
|
|
3232
|
+
L: 112,
|
|
3209
3233
|
S: this,
|
|
3210
3234
|
C: (f, a) => f(...a)
|
|
3211
3235
|
});
|
|
@@ -3222,7 +3246,7 @@ var AutomergeHost = class {
|
|
|
3222
3246
|
isAuthorized
|
|
3223
3247
|
}, {
|
|
3224
3248
|
F: __dxlog_file16,
|
|
3225
|
-
L:
|
|
3249
|
+
L: 118,
|
|
3226
3250
|
S: this,
|
|
3227
3251
|
C: (f, a) => f(...a)
|
|
3228
3252
|
});
|
|
@@ -3230,7 +3254,7 @@ var AutomergeHost = class {
|
|
|
3230
3254
|
} catch (err) {
|
|
3231
3255
|
log15.catch(err, void 0, {
|
|
3232
3256
|
F: __dxlog_file16,
|
|
3233
|
-
L:
|
|
3257
|
+
L: 128,
|
|
3234
3258
|
S: this,
|
|
3235
3259
|
C: (f, a) => f(...a)
|
|
3236
3260
|
});
|
|
@@ -3265,8 +3289,8 @@ var AutomergeHost = class {
|
|
|
3265
3289
|
});
|
|
3266
3290
|
}
|
|
3267
3291
|
_onUpdate(event) {
|
|
3268
|
-
const spaceKey = event.doc
|
|
3269
|
-
if (!spaceKey) {
|
|
3292
|
+
const spaceKey = getSpaceKeyFromDoc(event.doc);
|
|
3293
|
+
if (!spaceKey || this._metadata == null) {
|
|
3270
3294
|
return;
|
|
3271
3295
|
}
|
|
3272
3296
|
const objectIds = getInlineChanges(event);
|
|
@@ -3278,17 +3302,21 @@ var AutomergeHost = class {
|
|
|
3278
3302
|
if (!lastAvailableHash) {
|
|
3279
3303
|
return;
|
|
3280
3304
|
}
|
|
3281
|
-
const
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3305
|
+
const encodedIds = objectIds.map((objectId) => idCodec.encode({
|
|
3306
|
+
documentId: event.handle.documentId,
|
|
3307
|
+
objectId,
|
|
3308
|
+
spaceKey
|
|
3309
|
+
}));
|
|
3310
|
+
const idToLastHash = new Map(encodedIds.map((id) => [
|
|
3311
|
+
id,
|
|
3312
|
+
lastAvailableHash
|
|
3313
|
+
]));
|
|
3314
|
+
const markingDirtyPromise = this._metadata.markDirty(idToLastHash).then(() => {
|
|
3287
3315
|
this._updatingMetadata.delete(event.handle.documentId);
|
|
3288
3316
|
}).catch((err) => {
|
|
3289
|
-
|
|
3317
|
+
this._ctx.disposed && log15.catch(err, void 0, {
|
|
3290
3318
|
F: __dxlog_file16,
|
|
3291
|
-
L:
|
|
3319
|
+
L: 191,
|
|
3292
3320
|
S: this,
|
|
3293
3321
|
C: (f, a) => f(...a)
|
|
3294
3322
|
});
|
|
@@ -3349,7 +3377,7 @@ var AutomergeHost = class {
|
|
|
3349
3377
|
deviceKey
|
|
3350
3378
|
}, {
|
|
3351
3379
|
F: __dxlog_file16,
|
|
3352
|
-
L:
|
|
3380
|
+
L: 258,
|
|
3353
3381
|
S: this,
|
|
3354
3382
|
C: (f, a) => f(...a)
|
|
3355
3383
|
});
|
|
@@ -3390,6 +3418,13 @@ var getInlineChanges = (event) => {
|
|
|
3390
3418
|
...inlineChangedObjectIds
|
|
3391
3419
|
];
|
|
3392
3420
|
};
|
|
3421
|
+
var getSpaceKeyFromDoc = (doc) => {
|
|
3422
|
+
const rawSpaceKey = doc.access?.spaceKey ?? doc.experimental_spaceKey;
|
|
3423
|
+
if (rawSpaceKey == null) {
|
|
3424
|
+
return null;
|
|
3425
|
+
}
|
|
3426
|
+
return String(rawSpaceKey);
|
|
3427
|
+
};
|
|
3393
3428
|
|
|
3394
3429
|
export {
|
|
3395
3430
|
codec,
|
|
@@ -3419,6 +3454,7 @@ export {
|
|
|
3419
3454
|
AutomergeStorageAdapter,
|
|
3420
3455
|
LocalHostNetworkAdapter,
|
|
3421
3456
|
MeshNetworkAdapter,
|
|
3422
|
-
AutomergeHost
|
|
3457
|
+
AutomergeHost,
|
|
3458
|
+
getSpaceKeyFromDoc
|
|
3423
3459
|
};
|
|
3424
|
-
//# sourceMappingURL=chunk-
|
|
3460
|
+
//# sourceMappingURL=chunk-XR2636AC.mjs.map
|