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

Updates for Fastify v5 #1193

Merged
merged 10 commits into from
Sep 11, 2024
Merged

Updates for Fastify v5 #1193

merged 10 commits into from
Sep 11, 2024

Conversation

mcollina
Copy link
Member

@mcollina mcollina commented Sep 6, 2024

I had to add a bunch of @ts-expect-error to make things pass, as I have no time to understand why the types here are not behaving.

Checklist

synapse and others added 4 commits March 23, 2024 09:36
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
@bencoder
Copy link

bencoder commented Sep 9, 2024

Typing issues are due to conflicting differences between @fastify/session and @fastify/secure-session (which does not have regenerate method).

There is a TODO in the code here that would go some way to fixing it:

// TODO: This is quite hacky. The best option would be having a regenerate method
// on secure-session as well

Have raised issue in fastify-secure-session to action this TODO so we can tidy that up.

If there's any urgency to this PR then we could approve it as-is with a follow-up ticket here to clean up once the types are improved on secure-session

@robwalkerco
Copy link
Contributor

robwalkerco commented Sep 9, 2024

I've also had a brief investigation of the types issues, and have created a patch PR that resolves them by more explicitly typing the request data as FastifyRequest & { session: FastifySessionObject | Session<any> }.

I've opened a PR against this PR that resolves the type issues (except the @ts-expect-error comments in the tests).

* chore: fix type issues

* lint

* Fix linting

I'll investigate why this rule needs to be disabled when I get a chance. 

Signed-off-by: Rob Walker <hi@robwalker.co>

* linting

---------

Signed-off-by: Rob Walker <hi@robwalker.co>
@mcollina
Copy link
Member Author

@dancastillo @Uzlopak @climba03003 fancy a review?

Copy link
Member

@dancastillo dancastillo left a comment

Choose a reason for hiding this comment

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

LGTM - just one small comment

src/session-managers/SecureSessionManager.ts Outdated Show resolved Hide resolved
Co-authored-by: Dan Castillo <dan.castillo@jasper.ai>
Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
@mcollina mcollina merged commit 8b87f8b into main Sep 11, 2024
13 checks passed
@mcollina mcollina deleted the updates branch September 11, 2024 16:24
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.

6 participants