Skip to content

Commit e64e5c1

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

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
@@ -54,7 +54,6 @@ import type {
5454
} from "@/registry/config";
5555
import {
5656
decodeCborCompat,
57-
decodeCborJsonCompat,
5857
encodeCborCompat,
5958
} from "@/serde";
6059
import { getEnvUniversal, VERSION } from "@/utils";
@@ -594,7 +593,7 @@ function decodeValue<T>(value?: RuntimeBytes | null): T {
594593
return undefined as T;
595594
}
596595

597-
return decodeCborJsonCompat(value);
596+
return decodeCborCompat(value);
598597
}
599598

600599
function encodeValue(value: unknown): RuntimeBytes {
@@ -931,6 +930,7 @@ function serializeWorkflowEntryKind(
931930
}
932931
}
933932

933+
// TODO: Switch inspector routes to CBOR encoding
934934
function serializeWorkflowHistoryForJson(data: ArrayBuffer | null): {
935935
nameRegistry: string[];
936936
entries: Array<{
@@ -964,7 +964,7 @@ function serializeWorkflowHistoryForJson(data: ArrayBuffer | null): {
964964

965965
const history = decodeWorkflowHistoryTransport(data);
966966

967-
return {
967+
return jsonSafe({
968968
nameRegistry: [...history.nameRegistry],
969969
entries: history.entries.map((entry) => ({
970970
id: entry.id,
@@ -994,7 +994,7 @@ function serializeWorkflowHistoryForJson(data: ArrayBuffer | null): {
994994
],
995995
),
996996
),
997-
};
997+
});
998998
}
999999

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

0 commit comments

Comments
 (0)