Skip to content

Commit dde607a

Browse files
Bump protocol version
1 parent d17655b commit dde607a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/io/decoder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type DecoderState = { state: number; header: Header | undefined; buf: Buffer };
3232
const WAITING_FOR_HEADER = 0;
3333
const WAITING_FOR_BODY = 1;
3434

35-
export const SUPPORTED_PROTOCOL_VERSION = 0;
35+
export const SUPPORTED_PROTOCOL_VERSION = 1;
3636

3737
function initalDecoderState(buf: Buffer): DecoderState {
3838
return {

test/protocol_stream.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { Header, Message } from "../src/types/types";
2323
import stream from "stream";
2424
import { setTimeout } from "timers/promises";
2525
import { CompletablePromise } from "../src/utils/promises";
26+
import { SUPPORTED_PROTOCOL_VERSION } from "../src/io/decoder";
2627

2728
// The following test suite is taken from headers.rs
2829
describe("Header", () => {
@@ -89,7 +90,9 @@ describe("Restate Streaming Connection", () => {
8990
id: Buffer.from("abcd"),
9091
debugId: "abcd",
9192
knownEntries: 1337,
92-
})
93+
}),
94+
undefined,
95+
SUPPORTED_PROTOCOL_VERSION
9396
)
9497
);
9598

test/protoutils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ import { expect } from "@jest/globals";
6767
import { jsonSerialize, formatMessageAsJson } from "../src/utils/utils";
6868
import { rlog } from "../src/logger";
6969
import { ErrorCodes, RestateErrorCodes } from "../src/types/errors";
70+
import { SUPPORTED_PROTOCOL_VERSION } from "../src/io/decoder";
7071

7172
export function startMessage(
7273
knownEntries?: number,
@@ -86,7 +87,7 @@ export function startMessage(
8687
partialState: partialState !== false,
8788
}),
8889
undefined,
89-
0,
90+
SUPPORTED_PROTOCOL_VERSION,
9091
undefined
9192
);
9293
}

0 commit comments

Comments
 (0)