Coder Social home page Coder Social logo

Comments (8)

0x0ece avatar 0x0ece commented on June 18, 2024 1

FYI, in the meantime we've released our modified version of express-session:
https://github.com/saasform/saasform/tree/main/packages/express-session

The new MemoryStore prevents resaving destroyed sessions, i.e. does what I'm planning to implement here.

We also added tests to validate that the original express session suffers from the race condition, while in the new implementation the race condition is fixed.

from connect-typeorm.

nykula avatar nykula commented on June 18, 2024

Hi! Asking the users to add a column to their entity is a major API change, but it's time to bump the major anyway. Old typeorm has known dependency vulnerabilities, so before any new release I should bump the version requirements and remove the code paths no longer used. I don't know when I'll have time to work on this, so I welcome your pull requests. #7 (test cases for custom type-safe session fields) and #24 (debug tediousjs Bigint issue) have been on my todo list for quite a while, too.

from connect-typeorm.

0x0ece avatar 0x0ece commented on June 18, 2024

ok thanks - I'll work on it. Definitely agree it's a major API change.

from connect-typeorm.

0x0ece avatar 0x0ece commented on June 18, 2024

I opened a PR - it turned out to be much more simple and at the same time much more complex than expected. Simple because typeorm has the soft delete. Complex because just the soft delete didn't solve the update issue.

Please take a look at the comments in the PR and lmk your thoughts. If this is too big of a change we can also publish this as @saasform/typeorm-connect like we did for express-session.

from connect-typeorm.

nykula avatar nykula commented on June 18, 2024

LGTM so merged, thank you! To anyone also reading this, please see if you can suggest how to work around the need for (session as any) cast with recent express-session typings.

from connect-typeorm.

0x0ece avatar 0x0ece commented on June 18, 2024

Great, thank you! Please lmk when you file a new release so I'll note the version.

from connect-typeorm.

jdhuntington avatar jdhuntington commented on June 18, 2024

Thanks for this PR!

I noticed that with this change, any soft deletes are likely to persist forever. There might be a subtle timing issue if a logout happened close in time to when a session would expire, but I believe #27 is a useful fix for most use cases.

from connect-typeorm.

freshgiammi avatar freshgiammi commented on June 18, 2024

Merged.

from connect-typeorm.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.