Skip to content

Conversation

@magnetised
Copy link
Contributor

Fixes #53

@magnetised magnetised force-pushed the 53-allow-for-transformation-of-messages-from-the-upstream-server-before-passing-to-clients branch from cc47e8e to b79d372 Compare September 2, 2025 12:59
@magnetised magnetised requested a review from thruflo September 4, 2025 09:45
@magnetised magnetised force-pushed the 53-allow-for-transformation-of-messages-from-the-upstream-server-before-passing-to-clients branch 2 times, most recently from 8555ea1 to 9899e63 Compare September 4, 2025 14:28
@evanob
Copy link

evanob commented Sep 4, 2025

@magnetised I tried this myself and it works really nicely!

The only problem is when the payload starts to get large, in which case I start to get errors like (Jason.DecodeError) unexpected end of input at position 157004 coming from Phoenix.Sync.Electric.map_response_body/2. My best guess is that this is caused by incomplete JSON when the response is chunked 😬

Copy link
Contributor

@thruflo thruflo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff 👍

@magnetised
Copy link
Contributor Author

@magnetised I tried this myself and it works really nicely!

The only problem is when the payload starts to get large, in which case I start to get errors like (Jason.DecodeError) unexpected end of input at position 157004 coming from Phoenix.Sync.Electric.map_response_body/2. My best guess is that this is caused by incomplete JSON when the response is chunked 😬

That's not good... Will see if I can reproduce & fix. Thanks!

@magnetised magnetised force-pushed the 53-allow-for-transformation-of-messages-from-the-upstream-server-before-passing-to-clients branch from 9899e63 to 35b6353 Compare September 8, 2025 10:59
@magnetised
Copy link
Contributor Author

My best guess is that this is caused by incomplete JSON when the response is chunked 😬

@evanob actually caused by my dumb implementation of the stream mapping... Fixed, thanks

@magnetised magnetised merged commit 867ca80 into main Sep 8, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow for transformation of messages from the upstream server before passing to clients

4 participants