amalgm 0.1.162 → 0.1.163
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/package.json
CHANGED
|
@@ -853,9 +853,11 @@ function loadDocEntry(pathInput) {
|
|
|
853
853
|
function openDoc(pathInput) {
|
|
854
854
|
const Y = loadYjs();
|
|
855
855
|
const entry = loadDocEntry(pathInput);
|
|
856
|
+
const replica = require('./replicas').getReplicaByLocalResource(entry.resource);
|
|
856
857
|
return {
|
|
857
858
|
resource: entry.resource,
|
|
858
859
|
nodeId: entry.nodeId,
|
|
860
|
+
cloudResourceId: replica?.resourceId || entry.nodeId || null,
|
|
859
861
|
path: entry.path,
|
|
860
862
|
state: Buffer.from(Y.encodeStateAsUpdate(entry.doc)).toString('base64'),
|
|
861
863
|
// The versioned-write handshake: hash of the exact current text; a writer
|
|
@@ -113,6 +113,7 @@ test('promotion is durable, idempotent, and installs the runtime-owned cloud bin
|
|
|
113
113
|
assert.equal(replica.localPath, target);
|
|
114
114
|
assert.equal(replica.appliedVersion, 0);
|
|
115
115
|
assert.equal(replica.contract, 'text-yjs@1');
|
|
116
|
+
assert.equal(docs.openDoc(target).cloudResourceId, resourceId);
|
|
116
117
|
});
|
|
117
118
|
|
|
118
119
|
test('batched surface edits retain separate IDs/versions and recipient file precedes UI event', () => {
|