* Fix bug where updated webhook options failed to save This bug was caused by Mongoose not creating getters/setters for array elements (https://mongoosejs.com/docs/faq.html#array-changes-not-saved). So, although the webhook was being updated properly, Mongoose was not actually committing it to the database. Telling Mongoose that the array of webhooks has changed via `markModified` fixes the issue. Additionally, the relevant API test case was only checking whether or not the webhook returned from the PUT endpoint matched the expected update. Since the endpoint was returning the updated webhook without querying the database again, this test case would pass. It has been updated to check both the returned webhook as well as the version of the webhook that is saved to the database against the expected. In other words: `assert returned === saved === expected` Fixes #12336 * Call markModified on webhook.options instead of user.webhooks This tells Mongoose that only the modified webhook's options changed instead of telling it that the entire user.webhooks array changed, saving a costly DB update.
Habitica

Habitica is an open source habit building program which treats your life like a Role Playing Game. Level up as you succeed, lose HP as you fail, earn money to buy weapons and armor.
We need more programmers! Your assistance will be greatly appreciated. The wiki pages below and the additional pages they link to will tell you how to get started on contributing code and where you can go to seek further help or ask questions:
- Guidance for Blacksmiths - an introduction to the technologies used and how the software is organized.
- Setting up Habitica Locally - how to set up a local install of Habitica for development and testing on various platforms.
Habitica's code is licensed as described at https://github.com/HabitRPG/habitica/blob/develop/LICENSE
Found a bug? Please report it in the Report a Bug guild rather than creating an issue (an admin will advise you if a new issue is necessary; usually it is not).
Have any questions about Habitica or its community? See the links in the habitica.com website's Help menu or drop in to Guilds > Tavern Chat to ask questions or chat socially!