Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump protocol version #262

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/io/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type DecoderState = { state: number; header: Header | undefined; buf: Buffer };
const WAITING_FOR_HEADER = 0;
const WAITING_FOR_BODY = 1;

export const SUPPORTED_PROTOCOL_VERSION = 0;
export const SUPPORTED_PROTOCOL_VERSION = 1;

function initalDecoderState(buf: Buffer): DecoderState {
return {
Expand Down
5 changes: 4 additions & 1 deletion test/protocol_stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { Header, Message } from "../src/types/types";
import stream from "stream";
import { setTimeout } from "timers/promises";
import { CompletablePromise } from "../src/utils/promises";
import { SUPPORTED_PROTOCOL_VERSION } from "../src/io/decoder";

// The following test suite is taken from headers.rs
describe("Header", () => {
Expand Down Expand Up @@ -89,7 +90,9 @@ describe("Restate Streaming Connection", () => {
id: Buffer.from("abcd"),
debugId: "abcd",
knownEntries: 1337,
})
}),
undefined,
SUPPORTED_PROTOCOL_VERSION
)
);

Expand Down
3 changes: 2 additions & 1 deletion test/protoutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import { expect } from "@jest/globals";
import { jsonSerialize, formatMessageAsJson } from "../src/utils/utils";
import { rlog } from "../src/logger";
import { ErrorCodes, RestateErrorCodes } from "../src/types/errors";
import { SUPPORTED_PROTOCOL_VERSION } from "../src/io/decoder";

export function startMessage(
knownEntries?: number,
Expand All @@ -86,7 +87,7 @@ export function startMessage(
partialState: partialState !== false,
}),
undefined,
0,
SUPPORTED_PROTOCOL_VERSION,
undefined
);
}
Expand Down
Loading