* Partially revert GET /db/:collection/:handle/patches, as it returned limited results for versioned docs
* Fix POST /db/:collection/:handle/patch to:
* normalize diffs based on latest doc version
* handle empty deltas
* not swallow thrown errors due to _.curry
* Set 'target.original' correctly for versioned collections
Previously, when diplomats submit translations, the system
would try to figure out whether it should be a 'patch' or a 'change',
and then would either create a patch for an admin or artisan to
review and accept or reject, or would apply the changes immediately
and they would be live. This was done as a compromise between
getting translations live quickly, but also preventing already-translated
text from getting overwritten without oversight.
But having the client handle this added logical complexity. So
this makes all diplomats submit patches, no matter what. The server
is then in charge of deciding if it should auto-accept the patch or not.
Either way, a patch is created.
There was also much refactoring. This commit includes:
* Update jsondiffpatch so changes within array items are handled correctly
* Refactor posting patches to use the new auto-accepting logic, and out of Patch model
* Refactor POST /db/patch/:handle/status so that it doesn't rely on handlers
* Refactor patch stat handling to ensure auto-accepted patches are counted
* Refactor User.incrementStat to use mongodb update commands, to avoid race conditions
* Refactor Patch tests
* Clients check updated achievements as well as new ones
* Clients do not wait to keep checking
* Update achievement points along with everything else in EarnedAchievement.upsertFor
* Fix various bugs
When a new version is created, the latest version is updated, then
the new one is made. If making a new one fails (most commonly due to
a name conflict), the latest version is left in a broken state. Set up
the new middleware to revert changes to latest version in this case,
and update the level handler to use the middleware. Also added
warning logs if models do not have editableProperties or postEditableProperties
set.
Address some code review feedback
Correct error code in test
Don't try to send emails to empty addresses
Add tests for subscriptions
Add tests for Next Steps email
Fix specs
Add reason for disabled test
Update classroom and gameplay Ux to surface practice levels as 3a, 3b,
etc.
Update next level logic to leverage practice levels based on per level
completion playtime thresholds.
Patrol buster and patrol buster A are live for testing.
Fix a few classroom Ux progress hover bubble info bugs.
Closes#3767
* Initial pass adding new game-dev level type.
* Fix a failing test with updated LevelSystem required properties
* Bring back normal Angel worker timeout times
* Fix another failing LevelSystem test since removing propertyDocumentation
* Switch from auth.loginUser to User.loginPasswordUser with Promise
* Remove a cascade of unused views that were using auth.loginUser: StudentLogInModal, StudentSignupModal, HourOfCodeView
* Also remove auth.createUser