Add INNER_VOICE clan task and balanced daily-task generation - #981
Conversation
…complete INNER_VOICE when clan phrase changes
tickBit
left a comment
There was a problem hiding this comment.
Great work 👍 ! Approved.
I looked carefully and to get context looked also other files and noticed a bug outside this PR. In dailyTask.queue.ts at line 56 there is field playerId, it should be player_id to clear the ID:
$unset: {
player_id: '', // Correct, but at the moment there is playerId
startedAt: '',
}
Just wondering, that could you also change that field name in dailyTask.queue.ts in this PR? It's one field in one line only.
The branch was out of date, I updated it from the UI, so refreshing the branch locally is necessary. I'll wait until Monday morning before merging. That other fix isn't required. It can be fixed in other PR, too.
I fixed this naming mismatch, but i also spotted another similar one at dailyTasks.schema.ts at line 54: |
Good observation! I missed that. Yes, I think, that it should be |
|
Nice! Now all all tests are green 👍 . I'll merge this now. |
|
Failing daily-task CI tests? Root cause: clan and unreserved tasks use player_id: null. The previous unique sparse index still indexed null, so MongoDB allowed only one such task and rejected subsequent task creation as a duplicate key. NOTE: A one-time production database maintenance step is required after deployment. The database currently has an old daily-task rule that treats every clan/unreserved task as the same because they have no player ID. A database admin must replace that rule with the new one, which allows multiple clan/unreserved tasks while still allowing each player to reserve only one task at a time. |
Brief description
(closes #967 & #974 )
Adds the clan-level INNER_VOICE daily task and replaces random initial server-task generation with a balanced shuffled task bag. Updating a clan’s phrase to a new value completes INNER_VOICE, rewards the clan, and publishes a clan MQTT update after the database transaction commits.
Change list