Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix / route with prefix in fastify@v3.10.1 #98

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

Merged
merged 1 commit into from
Jan 16, 2021
Merged

Fix / route with prefix in fastify@v3.10.1 #98

merged 1 commit into from
Jan 16, 2021

Conversation

mcollina
Copy link
Member

Fix #97

Checklist

@@ -113,6 +110,6 @@ function close (fastify, done) {
}

module.exports = fp(fastifyWebsocket, {
fastify: '3.x',
fastify: '>= 3.10.1',
Copy link
Member

Choose a reason for hiding this comment

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

This does not qualify as a breaking change?

Copy link
Member

Choose a reason for hiding this comment

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

Nope, in a real world application you should use lock files, so this wouldn't impact you until you want to upgrade.

Copy link

@Skn0tt Skn0tt left a comment

Choose a reason for hiding this comment

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

If removing this line really fixes it - then why was that line necessary before? Was the double onRoute a bug in Fastify?
Because otherwise, that‘d be a breaking change in 3.10 (a Minor) that‘s mentioned nowhere in the release notes.

@mcollina
Copy link
Member Author

This was caused by: https://github.com/fastify/fastify/pull/2782/files. We had a few bugs in other plugins because it was called twice.

(Note that the change in Fastify was not causing any tests failures here).

cc @salmanm

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

LGTM

We should add a similar test in Fastify core.

@mcollina mcollina merged commit 11d4b12 into master Jan 16, 2021
@salmanm
Copy link
Member

salmanm commented Jan 16, 2021

@Skn0tt double onRoute was called when prefixTrailingSlash was set to both. However, this behavior was neither expected (or at least I think so, coz single route definition triggering two onRoute) nor documented. Hence, we removed this double trigger.

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.

Fastify 3.10 breaks prefixed plugins
5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.