LouisK130 / IFCB-Annotate

A web-based interface for classifying IFCB image data
3 stars 2 forks source link

infinite recursion in moveToNextView (hotkeys.js) #14

Closed joefutrelle closed 7 years ago

joefutrelle commented 7 years ago

To reproduce:

Then there will be a pause where the app is frozen, followed by a "maximum stack size exceeded" in the js console, on the fn moveToNextView in hotkeys.js (which calls itself)

Tested in Firefox and Chrome

joefutrelle commented 7 years ago

Here's the full stacktrace

Uncaught RangeError: Maximum call stack size exceeded
    at Array.sort (native)
    at getTargetsInCategory (http://oneeyedjack.whoi.edu/static/javascript/utils.js:192:10)
    at reloadTargets (http://oneeyedjack.whoi.edu/static/javascript/classify.js:126:20)
    at moveToNextView (http://oneeyedjack.whoi.edu/static/javascript/hotkeys.js:102:3)
    at moveToNextView (http://oneeyedjack.whoi.edu/static/javascript/hotkeys.js:104:4)
    at moveToNextView (http://oneeyedjack.whoi.edu/static/javascript/hotkeys.js:104:4)
    at moveToNextView (http://oneeyedjack.whoi.edu/static/javascript/hotkeys.js:104:4)
    at moveToNextView (http://oneeyedjack.whoi.edu/static/javascript/hotkeys.js:104:4)
    at moveToNextView (http://oneeyedjack.whoi.edu/static/javascript/hotkeys.js:104:4)
    at moveToNextView (http://oneeyedjack.whoi.edu/static/javascript/hotkeys.js:104:4)
LouisK130 commented 7 years ago

I'm on my laptop and not well-equipped to make an update and commit, but the solution is simple. Somehow a return; got removed from static/javascript/hotkeys.js.

See line 96 at the link below and add a return to that else block that's empty for no apparent reason.

https://github.com/LouisK130/Manual-Classify/blob/master/python/env/manualclassify/classify/static/javascript/hotkeys.js#L96

joefutrelle commented 7 years ago

oops

LouisK130 commented 7 years ago

I think I accidentally lost it when I reworked that function a while back, not you. I guess I hadn't tested against any empty bins since then.