cayasso/oomvc — Issue #21: BUG: obj is undefined 
Author: noctivityinc
Created: 2011-10-31 00:57:47+00:00
State: open

Here is a replicable example of the bug. Use this in place of controller.js in the OOMVC project:

http://pastie.textmate.org/private/jg1emeqq5y456ukinixa6a

You will notice that what it's doing is updating a goal, then deleting all tasks for that goal, then adding new tasks and then attempting to REPEAT the process (as if the user wanted to do something again, which happens a lot in the dimensions project, such as adding multiple windows).

The problem ONLY happens when an _instance level_ destroy action occurs. If I replace this:

itm.destroy(group());

with

Task.delete(itm.id, group());

then the error does not occur. Also, if in Model.js I comment line 1233 :

delete DB[self._model][index];

then the instance level works also. I believe that this bug and bug #18 are related, so hopefully fixing one will fix the other.