superscript-editor icon indicating copy to clipboard operation
superscript-editor copied to clipboard

Assigning topic crashes the editor

Open siddharthg opened this issue 10 years ago • 4 comments

When I add a gambit to a newly created topic, it crashes the node and give me the following error. I could reproduce the same multiple types.

/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/lib/topics/sort.js:108
        var kind_sorted = Object.keys(track[ip][kind]).sort(function(a,b) { re
                                               ^
TypeError: Cannot read property 'qtype' of undefined
    at Object.exports.sortTriggerSet (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/lib/topics/sort.js:108:48)
    at /Users/siddharthgupta/git/superscript-editor/node_modules/superscript/lib/topics/topic.js:70:26
    at /Users/siddharthgupta/git/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:240:13
    at async.each (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:114:20)
    at _asyncMap (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:234:9)
    at Object.map (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/node_modules/async/lib/async.js:212:23)
    at model.topicSchema.methods.sortGambits (/Users/siddharthgupta/git/superscript-editor/node_modules/superscript/lib/topics/topic.js:69:11)
    at Immediate.<anonymous> (/Users/siddharthgupta/git/superscript-editor/controllers/gambits.js:140:25)
    at Immediate._onImmediate (/Users/siddharthgupta/git/superscript-editor/node_modules/mongoose/node_modules/mquery/lib/utils.js:137:16)
    at processImmediate [as _immediateCallback] (timers.js:367:17)

siddharthg avatar Jul 17 '15 12:07 siddharthg

Im having a hard time reproducing this. I can see the problem is related to sorting gambits within a topic, are you sorting them by dragging and dropping them or clicking the sort button.

Are you adding the gambit though the normal form or the chat / quick add form?

silentrob avatar Jul 17 '15 16:07 silentrob

Editor crashing when sorting happened to me previously, too, but only after deleting some gambits in the topic.

mariusursache avatar Jul 17 '15 18:07 mariusursache

I am adding this gambit through the home page of the editor, that just happens once I add a new gambit to a newly created topic, anything I should try to fix this thing?

siddharthg avatar Jul 18 '15 04:07 siddharthg

  1. Did you delete ANY gambit?
  2. In case you did, try clearing the whole database, and try to create a new gambit or more, then see if the above problem still happens.

mariusursache avatar Jul 18 '15 08:07 mariusursache