Skip to content

Commit 7d6a033

Browse files
committed
fix(json-crdt): 🐛 use right payload
1 parent f86ed4d commit 7d6a033

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/json-crdt-repo/remote/RemoteHistoryDemoServer.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ export class RemoteHistoryDemoServer implements RemoteHistory<Cursor, RemoteServ
2222
public async create(id: string, patches: RemotePatch[]): Promise<void> {
2323
await this.client.call('block.new', {
2424
id,
25-
patches: patches.map((patch, seq) => ({
26-
// TODO: seq and created should be set on server. (And returned back?)
27-
seq,
28-
created: Date.now(),
25+
patches: patches.map((patch) => ({
2926
blob: patch.blob,
3027
})),
3128
});

src/json-crdt-repo/remote/__tests__/RemoteHistoryServer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('.create()', () => {
3030
await remote.create(id, [{blob}]);
3131
const {data} = await caller.call('block.get', {id}, {});
3232
// console.log(data.patches);
33-
const model2 = Model.fromBinary(data.block.blob);
33+
const model2 = Model.fromBinary(data.model.blob);
3434
expect(model2.view()).toEqual({foo: 'bar'});
3535
});
3636
});

0 commit comments

Comments
 (0)