Support the ongoing development of Laravel.io →
Requests Database Validation
Last updated 5 months ago.
0

just thought I'd post my assessment for anybody who finds themselves in a similar situation

turns out I was correct in thinking this was a double submit issue,

I tested this by calling submit several times from the command line

 $('#form').submit(); $('#form').submit(); $('#form').submit();.... 
  • the first submit goes through successfully
  • the subsequent requests were lagging behind and now ignored by ajax handler but still firing on the network
  • for the first 4 or 5 lagged requests, the integrity constraint violation fires
  • for the remainder of the requests the validation kicks in and says the user already has used this email address (but they won't see this as we have already got past this stage from the first submit)

so it wasn't affecting my users, but it was causing unnecessary queries on the back end.

solved now by preventing form submit twice, unless there's an error callback first, at which point they can submit again.. which obviously I should have done in the first place ;)

Last updated 5 years ago.
0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

jmp909 jmp909 Joined 29 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.