fix: ts-proto snake_case to camelCase, Chat.gRPC.createRoom() empty id res field #770
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR disables
ts-proto
's snake_case to camelCase conversions.For whatever reason,
ts-proto
seems to match leading underscores as snake_case, even though they're technically not.Example: message field
_id
would becomeId
Besides being a nuisance, this resulted in generated types not really working as expected across server/client.
Eg:
Chat
module'screateRoom
was expected to returnId
server-side and receive the same field client-side, but we actually received an empty string (default gRPC value) instead.While at it, I also modified
DeleteRoomRequest
s signature to also return_id
(previouslyid
as a workaround).This should make the API consistent, while also matching the underlying db doc field naming.
The modifications in
Chat
's proto file are technically a breaking change, but I'm not denoting this via conventional commits as we're already in an alpha stage and the previous behavior was also sketchy at best.At least node users of
grpc-sdk
should become aware of this following an SDK bump.This change shouldn't break any in-code generated types usage as we only ever build internal Conduit protos + the official gRPC health check proto file, neither of which make use of snake_case naming.
I only slightly modified
Authorization
's nestedResource.Relation
andResource.Permission
message types, removing the explicit underscore prefix (ts-proto
doesn't use namespaces), which shouldn't really affect anything.Relevant generated types are never explicitly referenced either anyway.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
main
branchfix #xxx
, where "xxx" is the issue number)