Reducer args encoding is hand-rolled #4
Labels
No labels
area:defold
area:docs
area:infra
area:protocol
area:testing
kind:bug
kind:chore
phase:breadth
phase:core
phase:hardening
phase:slice
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
yuris/spacetimedb-defold#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
connection.call_reducersendsargsas a raw Lua array — correct only for positional product args. Complex types (sum types, nested) need schema-driven encoding.ponytail: hand-rolled until a real module needs sum types.
Resolved in
ee90548by observation rather than guesswork.The wire format is
JsonFormat::Single = ByteString— reducer args are a JSON string containing JSON:protocol.encode_clientnow takes a Lua array forargsand double-encodes it, passing a pre-encoded string through untouched. Verified end to end: the capturedTransactionUpdateframes are responses to exactly these calls committing on a live 2.8.2 server.Still open in principle: args whose types are sum types or nested products. Same rule applies (SATS-JSON inside the string), but the test module doesn't exercise them — revisit when a real module needs one.