Giter VIP home page Giter VIP logo

Comments (10)

Jonty avatar Jonty commented on September 15, 2024

Can we get more info on this? Is this exceptions chucked due to constraint violations? Exceptions due to shit code?

from website.

marksteward avatar marksteward commented on September 15, 2024

It seems exceptions thrown before db.session.commit don't stop the changes being saved. This means (for gocardless_start) if payment.bill_url() fails, you've still bought the tickets, but didn't get redirected, so they end up in limbo.

We probably need to add a top-level request exception handler that calls db.session.rollback. Alternatively, it might be sqlalchemy not using transactions correctly with sqlite (haven't tested with psql).

from website.

Jonty avatar Jonty commented on September 15, 2024

This sounds like the db connection has autocommit set?

from website.

marksteward avatar marksteward commented on September 15, 2024

Probably, I assumed that was Flask's responsibility. So the wrapper also needs to call begin.

from website.

JasperWallace avatar JasperWallace commented on September 15, 2024

i can test this with psql if it would help?

from website.

marksteward avatar marksteward commented on September 15, 2024

Heh, I was just about to do the same. Will leave it if you're confident :)

from website.

JasperWallace avatar JasperWallace commented on September 15, 2024

done, what exactly is the test case?

there is a db.session.commit() in buy_prepay_tickets so we are commiting before we generate the bill url...

maybe move the commit to just before we return the redirect?

from website.

JasperWallace avatar JasperWallace commented on September 15, 2024

Looks like this does not happen with postgres so we don't have to worry about it.

Not closeing, but removing from the milestone.

from website.

Jonty avatar Jonty commented on September 15, 2024

If this doesn't happen with postgres, why aren't we closing it?

from website.

marksteward avatar marksteward commented on September 15, 2024

If the same test been run against sqlite, I'm happy to. Will do this tomorrow.

from website.

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.