Skip to content

Commit 62e97f0

Browse files
committed
workspace: update transport-failure fake to the cursor RPC shape
The fetch watermark conversion to a rev/path cursor updated the SyncRPC return shapes across the wire, but the transportFailingBackend fake in the workspace tests kept returning the old scalar shape: appliedPushRev on push and fetchChanges, and fetchRev on watermarks. The driver now reads appliedPushCursor.rev and currentCursor off those results, so both transport-failure invalidation tests threw a TypeError reading rev off undefined. Return the cursor shape the real server produces: appliedPushCursor and currentCursor as rev/path pairs, and fetchCursor on watermarks. The other fakes in the package already moved over; this one was missed.
1 parent 350d4d3 commit 62e97f0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/workspace/src/workspace.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,13 +780,13 @@ describe("Workspace transport-failure invalidation", () => {
780780
} finally {
781781
reader.releaseLock();
782782
}
783-
return { rev: 0, appliedPushRev: input.senderRev };
783+
return { rev: 0, appliedPushCursor: { rev: input.senderRev, path: null } };
784784
},
785785
async fetchChanges() {
786786
if (shouldFail) throw new WorkspaceTransportError("WebSocket closed");
787787
return {
788-
currentRev: 0,
789-
appliedPushRev: 0,
788+
currentCursor: { rev: 0, path: null },
789+
appliedPushCursor: { rev: 0, path: null },
790790
stream: new ReadableStream<import("@cloudflare/dofs").ChangeEntry>({
791791
start(c) {
792792
c.close();
@@ -795,7 +795,7 @@ describe("Workspace transport-failure invalidation", () => {
795795
};
796796
},
797797
async watermarks() {
798-
return { currentRev: 0, pushRev: 0, fetchRev: 0 };
798+
return { currentRev: 0, pushRev: 0, fetchCursor: { rev: 0, path: null } };
799799
},
800800
};
801801
const backend: WorkspaceBackend = {

0 commit comments

Comments
 (0)