fix(rivetkit): decode bridge errors with actor: null#5056
Conversation
|
🚅 Deployed to the rivet-pr-5056 environment in rivet-frontend
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: fix(rivetkit): decode bridge errors with actor: nullOverviewThis PR fixes a bug (RVT-6296) where bridge error payloads containing Changes1. Validation guard in // Before
if (payload.actor !== undefined && !isActorSpecifier(payload.actor)) {
// After
if (payload.actor !== undefined && payload.actor !== null && !isActorSpecifier(payload.actor)) {Correct. Allows 2. Null coercion in // Before
actor: payload.actor,
// After
actor: payload.actor ?? undefined,Correct. IssuesMissing regression test. The existing test("decodes bridge payload with actor: null", () => {
const raw = `${BRIDGE_RIVET_ERROR_PREFIX}${JSON.stringify({
group: "actor",
code: "internal_error",
message: "fail",
actor: null,
})}`;
const decoded = decodeBridgeRivetError(raw);
expect(decoded).toBeInstanceOf(RivetError);
expect(decoded?.actor).toBeUndefined();
});Minor observations
SummaryThe fix is minimal, correct, and well-targeted. Both changes are necessary and consistent with the project's null-vs-undefined conventions. The only missing piece is a regression test for the |
fbaeef3 to
67b4f92
Compare
0eb8f51 to
5f7bac7
Compare
67b4f92 to
e402a50
Compare
e402a50 to
7b5d681
Compare
5f7bac7 to
24f24d7
Compare
24f24d7 to
cc6719f
Compare
7b5d681 to
8625f84
Compare
cc6719f to
211349e
Compare
8625f84 to
46973f2
Compare
46973f2 to
c5ef70f
Compare
211349e to
3d9e480
Compare
3d9e480 to
8f133bf
Compare
c5ef70f to
8708f6b
Compare
8708f6b to
e2a084d
Compare
8f133bf to
80c7cb9
Compare
e2a084d to
cebc486
Compare

Fixes RVT-6296