trailsjs / trailpack-sequelize

:package: Sequelize.js Trailpack http://sequelizejs.com
MIT License
5 stars 9 forks source link

Posts same value on unique column twice make the second request hang #35

Closed wongyouth closed 7 years ago

wongyouth commented 7 years ago

I have a User model with unique set on login column.

  static schema (app, Sequelize) {
    return {
      login: {
        type: Sequelize.STRING,
        unique: true,
        allowNull: false
      },
  }

And use footprints to test User model When I post 2 requests with same data, the second request hangs until timeout.

jaumard commented 7 years ago

Hi @wongyouth ! Strange behavior, did you have your project hosted somewhere ? Or can you create a small one in order to reproduce the problem ? I never had this problem before

wongyouth commented 7 years ago

Sure, I created a tiny app https://github.com/wongyouth/trailpack-sequelize-issue35.

jaumard commented 7 years ago

Ok I just test and can reproduce the problem, but's it's not where you say. The bug is under trailpack-express the controller doesn't end the request correctly. I'll try to fix it asap

jaumard commented 7 years ago

@wongyouth I just push a fix on trailpack-express, can you test with the master branch and let me know if it fix your issue please ?

wongyouth commented 7 years ago

@jaumard It fixed! Thanks for your quick reply.