HabitRPG/habitrpg — pull request #2513 by lefnire (2014-01-22 07:08:33+00:00)
Title: Spell-casting bug fixes & optimizations

fix(spells): some $rootScope.applying action fixes so cast-ending is immediate instead of waiting on response. Also, slim down party population to the essentials to avoid RequestEntityTooLarge.

@colegleason @paglias wondering if either of you have experience with Mongoose here. In the past, if I used a projection:

```coffeescript
User.findById ID, 'profile stats', (err,user)->
user.stats.hp++
user.save()
```

It would actually **delete** (from the database) any fields that weren't selected in the query. So like, it would create a "projected document" (slimmed down), but it wasn't smart enough to know not to send those missing fields up as part of the save. As a result, there are many times I use `User.update({_id:ID},MANUAL_UPDATE_OBJECT)` to avoid the scare.

It doesn't seem to be the issue anymore. I tested this PR a bunch, and everything seems safe. But I'm a bit scared given past experiences. Have you seen this before? Maybe I was doing something wrong in the past? Maybe Mongoose has been updated since to fix that issue?