Git Product home page Git Product logo

Comments (9)

dougwilson avatar dougwilson commented on May 17, 2024

Do you know what could cause this?

No. Many people have upgraded and you're the first to report an issue.

Is there now a different middleware ordering required because of that or is the patch not correct?

I can't say. You need to provide code I can run to see the issue so I can diagnose it and see what the issue is. The code should not require external databases and should include a note for how I reproduce the issue with the code.

from session.

mweibel avatar mweibel commented on May 17, 2024

I can't say. You need to provide code I can run to see the issue so I can diagnose it and see what the issue is. The code should not require external databases and should include a note for how I reproduce the issue with the code.

Ok yeah I'll try that soon.
First I'm trying to check what exactly causes this to happen. I've broken it down to the end.call calls which are not calling with the chunk and encoding parameters.

//Edit: more specifically: it seems to boil down (currently) to this line: 7077190#diff-168726dbe96b3ce427e7fedce31bb0bcR207
When replacing this line with end.call(res, chunk, encoding) it works.

//Edit2: With the default memory Store it works, might be that the connect-session-file store has an issue with this new code.

from session.

mweibel avatar mweibel commented on May 17, 2024

nevermind, it seems it's an issue with the connect-session-file, e.g. if setting useAsync there to true it works. Bit weird, will have to check it out or switch to a more updated file store.

from session.

dougwilson avatar dougwilson commented on May 17, 2024

nevermind, it seems it's an issue with the connect-session-file, e.g. if setting useAsync there to true it works. Bit weird, will have to check it out or switch to a more updated file store.

OK, I understand the issue now. req.session.save should be an async function (i.e. the line after it should be called before the body is called), but it looks like the store you are using calls it sync instead, which makes the end before the write below it. I can work-around this for people's stores that are basically broken.

from session.

mweibel avatar mweibel commented on May 17, 2024

should be an async function (i.e. the line after it should be called before the body is called), but it looks like the store you are using calls it sync instead, which makes the end before the write below it.

Hmm ok I understand. Pardon my probably false assumption, but couldn't it be that, even though the store might be using an async function, the end is called before the write (i.e. depending on the scheduling which is being done).

from session.

dougwilson avatar dougwilson commented on May 17, 2024

the end is called before the write (i.e. depending on the scheduling which is being done).

no. it would only occur when save is called sync, nothing else.

from session.

dougwilson avatar dougwilson commented on May 17, 2024

@mweibel if you want, try out the fix for your issue with npm install expressjs/session#1.6.x

from session.

mweibel avatar mweibel commented on May 17, 2024

Works, thanks!

from session.

dougwilson avatar dougwilson commented on May 17, 2024

Thank you very much for the confirmation. This has been published as version 1.6.4 and express 3.13.0 will automatically pick up this new version for you.

from session.

Related Issues (20)

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.