javascript is not finishing

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • In Progress
I have some complicated javascript that normally works fine, but lately,  the code is not finishing and I am not seeing any errors.  At least, the users are not seeing any.  I am wondering if there could be timeouts in javascript, or timeouts within QB?  

Any thoughts on how I can put in some code that might help point me to where the issue is?  Since it is sporadic, I can't reproduce it.
thanks in advance,
Dean
Photo of Dean

Dean

  • 636 Points 500 badge 2x thumb

Posted 4 months ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 28,304 Points 20k badge 2x thumb
Post the code. Add console logging statements to debug.

If I had to guess I would say that there is probably something you are doing with AJAX requests which are not sequenced properly and when network response time changes you code is not responding to events/promises in the assumed order.
Photo of Dean

Dean

  • 636 Points 500 badge 2x thumb
Thanks Dan, 

here is the first script that is called from the IOL.
https://pastebin.com/5L8wcZZ3

here is the include:

https://pastebin.com/0LKffavH

I think you are probably right about the order of the  AJAX calls.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 28,304 Points 20k badge 2x thumb
Sorry but that's over a thousand lines of code so I am not even going to look at it. I have a half dozen demos that are either near complete or half way done that I haven't gotten to yet ...

FWIW, I don't know if you are nesting your AJAX calls or chaining them together through then() continuations but there is a bug in the version of jQuery QuickBase is using (1.7.1) that shows up when you create a chain of two or more then() continuations. This may or may not be the problem but such a large piece of code should be broken up and the chain of promises very well understood.

Also, I saw an indication you were using the Save and Scooby Doo technique. There may be an issue with specific browsers (it should work in Chrome). I recall I added a fix to the technique but would have to research it myself as it has been a while.

If you need individual help you can contact me off world using the information in my profile:

https://getsatisfaction.com/people/dandiebolt