elysiajs / elysia-trpc

A plugin for Elysia that add support for using tRPC
MIT License
20 stars 17 forks source link

Only handle valid incoming messages and properly get the input data for a subscription route #4

Closed danieldunderfelt closed 1 year ago

danieldunderfelt commented 1 year ago

I got errors saying that "incoming.params.path" is undefined when using trpc subscriptions. Upon investigation, I noticed that the first "incoming" value is actually an empty array and not the object that is expected. I added a simple condition to filter out these invalid values.

My input value to the subscription route was also not coming though. When I logged the incoming object, I noticed that the input values are not in "incoming.params.input" directly, but there is an additional "json" level where the input values can be found. I added "json" to the object path for the input. Not sure if it's correct but it works.

SaltyAom commented 1 year ago

Got it, let get this merge

SaltyAom commented 1 year ago

Published under 0.6.1

danieldunderfelt commented 1 year ago

Epic, thanks!