Comments (8)
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.
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.
ok thanks - I'll work on it. Definitely agree it's a major API change.
from connect-typeorm.
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.
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.
Great, thank you! Please lmk when you file a new release so I'll note the version.
from connect-typeorm.
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.
Merged.
from connect-typeorm.
Related Issues (19)
- Session destroy does not work HOT 1
- misused double quotes lead to error on PostgreSQL HOT 3
- Question about the Bigint transformer in the README HOT 2
- npm install throws an error Property 'observable' does not exist
- Allow TypeormStore to recover from failed request HOT 4
- Error Types [email protected] HOT 1
- Bigint issue with tedious HOT 3
- Maintainership of connect-typeorm HOT 8
- Let users define the name of the `expiredAt` column HOT 1
- Session `expiredAt` field is always updated in store (even if `resave` option set to false) HOT 1
- Is this project dead? HOT 8
- [BUG]: getRepository 'typeorm' is deprecated HOT 8
- Add tests HOT 3
- [BUG]: Spam Update after start server HOT 2
- [FEAT]: Documentation about TypeOrmStore in express-session in NestJS using PostgreSQL HOT 1
- How does stale session cleanup work? HOT 6
- cleanupLimit > 0 causes failure on MySQL & MariaDB backends HOT 4
- TypeORM: Delete statement was used alias name cause of exception if Table Name was changed. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connect-typeorm.