fix: query.live remote functions use SSE instead of ndjson stream (#15921)#15956
fix: query.live remote functions use SSE instead of ndjson stream (#15921)#15956IAkumaI wants to merge 1 commit into
Conversation
|
| * Each yielded value is the raw `JSON.parse`'d object from a `data:` field. | ||
| * @param {ReadableStreamDefaultReader<Uint8Array>} reader | ||
| */ | ||
| export async function* read_sse(reader) { |
There was a problem hiding this comment.
This seems pretty identical to read_ndjson... is there any way to share the logic?
There was a problem hiding this comment.
Yeah, I followed the existing style of the code.
I would say that if we do combine them to one, it'd be too...confusing. Monstrous reading-everything function with if if if? I'm not sure.
There was a problem hiding this comment.
I have it fixed locally, but I think you need to check the "Allow edits from maintainers" setting on your end so I can push up the fix
There was a problem hiding this comment.
It's on since the pr created https://github.com/user-attachments/assets/1315eb34-1cb1-4142-bc2f-03915c33eedf
There was a problem hiding this comment.
Oh. It's because your branch is named main, and it has branch protections, so it's not allowed to be pushed to 😆 One of GitHub's strange quirks. I'm going to push this up to another branch for review; you'll still get credit for your contributions!
…rmal streamed responses (#15957) closes #15956 closes #15921 closes (maybe) #15790? Some middlemen (antivirus, nginx) do weird buffer-y things with streamed responses, in spite of the no-store cache directives we use. SSE is more universal and seems to bypass some of these behaviors. TBD on whether this works for the nginx issue. Due to weird GitHub quirks I couldn't push to @IAkumaI's branch. This still contains his commits. --------- Co-authored-by: Akuma <meru.no.akuma@gmail.com> Co-authored-by: Rich Harris <rich.harris@vercel.com> Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
closes #15921
query.live had problems with some proxies on client side which blocked the stream indefinitely.
Now it uses SSE headers and data format (but kept usual
fetch) and should bypass those proxies.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits