forked from bytecodealliance/StarlingMonkey
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update from upstream - Fetch reworks #5
Merged
Merged
Conversation
This file contains 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
noise64
commented
Aug 1, 2024
•
edited
Loading
edited
- Updates from upstream to https://github.com/bytecodealliance/StarlingMonkey/tree/80a9d976ceb3d76a93b932c45302bc8ac2a52376
- Reapplies the current state of feat: single-tick non-tracking event loop runner bytecodealliance/StarlingMonkey#56
- Removes the previous custom event loop interest workarounds, but keeps the custom tests and runEventLoopUntilInterest
This is a large-scale rewrite of significant parts of the fetch API implementation that addresses a range of shortcomings and bugs in the previous code. Key changes are a better abstraction of host handles in the `host_api.h` header, cleaner handling of all the different object types involved in the fetch API, improved handling of strings and streams, and a whole bunch of bug fixes all over the place. Additionally, this includes various build system tweaks and some facilities for making debugging easier, such as the introduction of a way to build a component that doesn't include pre-evaluated JS and instead supports runtime evaluation of a script supplied in the incoming request's body.
This also applies some cleanups to Response creation overall.
Specifically, some of the `noGC` guards had issues that could lead to panics during exception throwing, and some of the loops over multiple buffers where overly complex.
Before this patch, timer (i.e., `setTimeout`/`setInterval`) returned the pollable handles as IDs. This is problematic, because pollable handles are reused, leading to content potentially clearing the wrong timer. Additionally, the code wasn't robust against a timer being cleared in its own callback, leading to a failing assertion. ----- This PR also includes the following changes: * Introduce an explicitly async test variant to the integration tests framework This cuts down on redundancy and is a bit easier to use, IMO. I didn't change all tests to use this instead of the existing async support, but we could consider doing that at some point. * Fix issues with timer subtest The test didn't properly clean up its timeout and interval, which meant that the former would throw an exception into the ether, and the latter would continue running the interval forever. (The exception thrown by the former also happened to be the wrong one, since `AssertionError` wasn't imported.)
This introduces support for adding typed error definitions in a modular way, such that extensions can define their own typed errors. This support is then also used in a few places, though more work can be done there.
…e#73) * Change all error reporting to use `api::throw_error` I went through the existing errors with a pretty fine comb and cleaned things up where it makes sense, instead of just moving things over mechanically. As a result, a few more WPT tests pass, and in general things are a bunch cleaner now, I think. * Address review comments * Fix test expectations
* Update to SpiderMonkey v127.0.2 This commit comes from bytecodealliance/spidermonkey-wasi-embedding#13 * Update main.yml * always use link-time-optimisations for rust-url dependency
it looks like openssl broke their links when they launched their new website? https://www.openssl.org/source/openssl-3.0.7.tar.gz 404s and is now at https://openssl.org/source/old/3.0/openssl-3.0.7.tar.gz
This fixes a crashing bug in a trivial scenario: event.respondWith(new Response(someUpstreamResponse.body, someUpstreamResponse); It's not entirely clear to me why WPT didn't catch this, though it's possible that the tests that would've done so abort early for trivial reasons, such as our missing FormData support. Instead, I added an e2e test to cover this, which fails without this patch. (There are small unrelated tweaks to the runtime-eval support which I applied in debugging the test.)
…etch-rework # Conflicts: # README.md # builtins/web/fetch/fetch-api.cpp # builtins/web/fetch/fetch_event.cpp # builtins/web/fetch/headers.cpp # builtins/web/fetch/headers.h # builtins/web/fetch/request-response.cpp # builtins/web/fetch/request-response.h # host-apis/wasi-0.2.0-rc-2023-10-18/host_api.cpp # host-apis/wasi-0.2.0-rc-2023-12-05/host_api.cpp # host-apis/wasi-0.2.0/host_api.cpp # include/extension-api.h # runtime/event_loop.cpp # tests/tests.cmake # tests/wpt-harness/wpt.cmake
# Conflicts: # builtins/web/fetch/request-response.cpp
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.