2/ Add tests for SSE transport#200
Closed
jmorrell-cloudflare wants to merge 7 commits intocloudflare:mainfrom
Closed
2/ Add tests for SSE transport#200jmorrell-cloudflare wants to merge 7 commits intocloudflare:mainfrom
jmorrell-cloudflare wants to merge 7 commits intocloudflare:mainfrom
Conversation
🦋 Changeset detectedLatest commit: ea2f7e6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
cf1e610 to
24638d2
Compare
workerd/io/worker.c++:1020: info: console warning; message = An event handler returned a promise that will be ignored. Event handlers should not have a return value and should not be async functions
24638d2 to
ea2f7e6
Compare
threepointone
approved these changes
Apr 23, 2025
| "evals": "(cd evals; evalite)", | ||
| "check:test": "vitest -r src/tests --watch false", | ||
| "test": "vitest -r src/tests", | ||
| "tevals": "(cd evals; evalite)", |
| // Send the message as an SSE event | ||
| const messageText = `event: message\ndata: ${JSON.stringify(result.data)}\n\n`; | ||
| await writer.write(encoder.encode(messageText)); | ||
| Promise.resolve(writer.write(encoder.encode(messageText))); |
Contributor
There was a problem hiding this comment.
Suggested change
| Promise.resolve(writer.write(encoder.encode(messageText))); | |
| await Promise.resolve(writer.write(encoder.encode(messageText))); |
| ws.addEventListener("error", (error) => { | ||
| try { | ||
| await writer.close(); | ||
| Promise.resolve(writer.close()); |
Contributor
There was a problem hiding this comment.
why did you replace the awaits with Promise.resolve()
Contributor
|
closing since we landed this in #186 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note: Stacked on top of #185 *
Before adding the Streamable transport it would be good to add some automated tests so that we don't break existing users. This adds some basic tests which exercise the existing SSE transport and sets up infrastructure so we can test the Streamable transport as well.