Skip to content

Commit 2c864a8

Browse files
committed
fix(rivetkit): fix BigInt serialization in inspector workflow history and state deserialization
1 parent da2b5fc commit 2c864a8

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

pnpm-lock.yaml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ packages:
1818
- scripts/tests
1919
- shared/typescript/*
2020
- website
21+
- ext/*
2122
- website/scripts/typecheck-staging
2223

2324
ignoredBuiltDependencies:

rivetkit-typescript/packages/rivetkit/src/registry/native.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import type {
5151
} from "@/registry/config";
5252
import {
5353
decodeCborCompat,
54-
decodeCborJsonCompat,
5554
encodeCborCompat,
5655
} from "@/serde";
5756
import { getEnvUniversal, VERSION } from "@/utils";
@@ -599,7 +598,7 @@ function decodeValue<T>(value?: RuntimeBytes | null): T {
599598
return undefined as T;
600599
}
601600

602-
return decodeCborJsonCompat(value);
601+
return decodeCborCompat(value);
603602
}
604603

605604
function encodeValue(value: unknown): RuntimeBytes {
@@ -936,6 +935,7 @@ function serializeWorkflowEntryKind(
936935
}
937936
}
938937

938+
// TODO: Switch inspector routes to CBOR encoding
939939
function serializeWorkflowHistoryForJson(data: ArrayBuffer | null): {
940940
nameRegistry: string[];
941941
entries: Array<{
@@ -969,7 +969,7 @@ function serializeWorkflowHistoryForJson(data: ArrayBuffer | null): {
969969

970970
const history = decodeWorkflowHistoryTransport(data);
971971

972-
return {
972+
return jsonSafe({
973973
nameRegistry: [...history.nameRegistry],
974974
entries: history.entries.map((entry) => ({
975975
id: entry.id,
@@ -999,7 +999,7 @@ function serializeWorkflowHistoryForJson(data: ArrayBuffer | null): {
999999
],
10001000
),
10011001
),
1002-
};
1002+
});
10031003
}
10041004

10051005
function toHttpJsonCompatible<T>(value: T): T {

0 commit comments

Comments
 (0)