You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: .useSubscription() results in undefined in data.data of onData() #5900
@BeBoRE Oh, weird, how so? It seems to be working for the regular query, if you check the repro again you can see that it's working for a regular query returning a date object.
Could you point out exactly what I'm doing wrong? I've been using an equivalent set-up (that is unless I transferred it wrong into the repro) for some time without issue.
This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.
Activity
BeBoRE commentedon Jul 15, 2024
You have your transformer setup incorrectly, if you change that it'll work
Katli95 commentedon Jul 15, 2024
@BeBoRE Oh, weird, how so? It seems to be working for the regular query, if you check the repro again you can see that it's working for a regular query returning a date object.
Could you point out exactly what I'm doing wrong? I've been using an equivalent set-up (that is unless I transferred it wrong into the repro) for some time without issue.
BeBoRE commentedon Jul 15, 2024
Idk useSubscription uses the input deserializer instead of the output deserializer (like the other links) to consume the stream, idk if that is a bug
BeBoRE commentedon Jul 15, 2024
Is this intentional @KATT?
trpc/packages/client/src/links/httpSubscriptionLink.ts
Line 98 in 755f287
Seems like everywhere else the output transformer is used:
trpc/packages/client/src/links/httpBatchStreamLink.ts
Line 101 in 755f287
trpc/packages/client/src/links/httpBatchLink.ts
Line 106 in 755f287
trpc/packages/client/src/links/httpLink.ts
Line 114 in 755f287
KATT commentedon Jul 15, 2024
Looks wrong indeed, nice find
Katli95 commentedon Jul 16, 2024
Awesome, yeah, good spot, I'll take a shot at fixing it with a PR!
Work in Progress Fork
github-actions commentedon Jul 17, 2024
This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.