-
Notifications
You must be signed in to change notification settings - Fork 336
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
fix: Pass ctx.props to default handlers #3465
base: main
Are you sure you want to change the base?
Conversation
7bede3c
to
06dc9cc
Compare
f874f4b
to
c26f53f
Compare
The generated output of |
c26f53f
to
f607315
Compare
f607315
to
7c05d79
Compare
What exactly is the intent here? The PR description needs some explanation and detail. If the idea is to give every invocation it's own unique context, then rather than cloning the entire thing the way this PR does, could it make sense to simply wrap the context in a JS Proxy object for every request and either CoW the underlying context or just intercept mutations so that the original remains unmodified? The per-request props can then be injected via the proxy. Wrapping in a proxy could likely reduce much of the complexity here. |
The goal of the change is to fix a known bug in which
BTW @tewaro we should update that comment to something like: "Historically, non-class-based handlers reused the same
That sounds way more complicated to me. This change as-is is really not very complex at all. I don't see what benefit a Proxy would provide here. |
f87e594
to
d3c5a1a
Compare
d3c5a1a
to
f2d764c
Compare
f2d764c
to
b53030f
Compare
@kentonv how do I force the feature flag on all tests? do I need to modify each one? |
@tewaro I'm just proposing that you temporarily change your code locally to enable the flag by default and make sure the tests actually pass. |
I've already done a test where I bump supported-compatibility-date.txt locally, is there anything more I need to do? |
Yes, please add a unit test of some sort, where the test directly enables the flag and verifies that ctx.props is then present when expected. You can perhaps modify or duplicate one of the existing tests for ctx.props in server-test.c++. |
Oh, this doesn't actually accomplish what I asked for earlier. To be clear, you need to do two things:
|
No description provided.