Skip to content
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: don't forward to next after responding #560

Merged
merged 3 commits into from
Apr 27, 2021

Conversation

ForsakenHarmony
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Apr 27, 2021

🦋 Changeset detected

Latest commit: 61dda5a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wmr Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented Apr 27, 2021

Size Change: -1 B (0%)

Total Size: 734 kB

Filename Size Change
packages/wmr/wmr.cjs 700 kB -1 B (0%)
ℹ️ View Unchanged
Filename Size Change
examples/demo/dist/about/index.html 673 B 0 B
examples/demo/dist/assets/Calendar.********.css 702 B 0 B
examples/demo/dist/assets/style.********.css 624 B 0 B
examples/demo/dist/chunks/class-fields.********.js 207 B 0 B
examples/demo/dist/chunks/compat.********.js 15.3 kB 0 B
examples/demo/dist/chunks/index.********.js 197 B 0 B
examples/demo/dist/chunks/json.********.js 235 B 0 B
examples/demo/dist/chunks/prerender.********.js 2.46 kB 0 B
examples/demo/dist/class-fields/index.html 657 B 0 B
examples/demo/dist/compat/index.html 1.51 kB 0 B
examples/demo/dist/env/index.html 728 B 0 B
examples/demo/dist/error/index.html 661 B 0 B
examples/demo/dist/files/index.html 692 B 0 B
examples/demo/dist/index.********.js 7.46 kB 0 B
examples/demo/dist/index.html 720 B 0 B
examples/demo/dist/json/index.html 671 B 0 B
examples/demo/dist/lazy-and-late/index.html 674 B 0 B

compressed-size-action

@@ -166,7 +166,6 @@ const injectWmrMiddleware = ({ cwd }) => {
} catch (e) {
next();
}
next();
Copy link
Member

Choose a reason for hiding this comment

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

Wait on second thought: Do we still need to call next() in the success case when we don't end the request?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh right, we do, kinda missed that if 🙈

Copy link
Member

Choose a reason for hiding this comment

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

I think this needs to be:

try {
  if (...) {
    res.end(result);
    return;
  }
} catch (e) {}
next();

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I moved out the if now

@marvinhagemeister marvinhagemeister dismissed their stale review April 27, 2021 21:13

missed something

Signed-off-by: Leah <github.leah@hrmny.sh>
@marvinhagemeister marvinhagemeister merged commit d5ecbef into main Apr 27, 2021
@marvinhagemeister marvinhagemeister deleted the fix-double-response branch April 27, 2021 22:06
@github-actions github-actions bot mentioned this pull request Apr 27, 2021
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.

3 participants