Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(contracts): decode growing config unions forward-compatibly #5055

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/5055/headmerged by juliusmarminge View on GitHub

Showing 6 changed files with 124 additions and 0 deletions (loading 3).

x
0 of 6 viewed, 6 left
34 additions and 0 deletionspackages/client-runtime/src/rpc/session.test.tsModified
View file
@@ -287,6 +287,40 @@
}),
​
+ it.effect("reaches ready when a newer server sends unknown config members", () =>
+ Effect.gen(function* () {
+ const { factory, sockets } = yield* makeFactory();
+ const session = yield* factory.connect(PREPARED);
+ const readyFiber = yield* Effect.forkChild(session.ready);
+ const socket = yield* awaitSocket(sockets);
+ socket.open();
+​
+ const shortcut = {
+ key: "p",
+ metaKey: false,
+ ctrlKey: false,
+ shiftKey: false,
+ altKey: false,
+ modKey: true,
+ };
+ yield* completeInitialConfig(socket, {
+ ...ENCODED_SERVER_CONFIG,
+ keybindings: [
+ { command: "someFuture.toggle", shortcut },
+ { command: "terminal.toggle", shortcut },
+ ],
+ issues: [{ kind: "keybindings.future-issue", message: "From a newer server" }],
+ availableEditors: ["some-future-editor", "zed"],
+ });
+ yield* Fiber.join(readyFiber);