Skip to content

Commit ec9c44c

Browse files
[bug] type adapter bugfix (#144)
Why === We missed a few places where we don't include `RiverError` in the emitted events, leading to codegen not passing typechecking. What changed ============ Patch in `| RiverError` in those cases where it is mandatory so at least we won't forget it. Test plan ========= _Describe what you did to test this change to a level of detail that allows your reviewer to test it_
1 parent 26ba67e commit ec9c44c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/replit_river/codegen/client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,12 @@ async def {name}(
10131013
]
10141014
)
10151015
elif procedure.type == "subscription":
1016+
output_or_error_type = UnionTypeExpr(
1017+
[
1018+
output_or_error_type,
1019+
TypeName("RiverError"),
1020+
]
1021+
)
10161022
current_chunks.extend(
10171023
[
10181024
reindent(
@@ -1086,6 +1092,12 @@ async def {name}(
10861092
]
10871093
)
10881094
elif procedure.type == "stream":
1095+
output_or_error_type = UnionTypeExpr(
1096+
[
1097+
output_or_error_type,
1098+
TypeName("RiverError"),
1099+
]
1100+
)
10891101
if init_type:
10901102
assert render_init_method, "Expected an init renderer!"
10911103
current_chunks.extend(

0 commit comments

Comments
 (0)