New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Shared completion for Group Dailies #11179
[WIP] Shared completion for Group Dailies #11179
Conversation
website/server/libs/groupTasks.js
Outdated
// If no assignedUser completes the due daily, all users lose their streaks at their cron | ||
// An alternative is to set the other assignedUsers' tasks to a later startDate | ||
// Should we break their streaks to encourage competition for the daily? | ||
task.completed = groupMemberTask.completed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main point of feature discussion.
I based my implimentation (complete other users' dailies) on cron: https://github.com/HabitRPG/habitica/blob/develop/website/server/libs/cron.js#L310
The implications of completing the task are that:
- The user who completes the Daily will score the task
- Other users will see the Daily is completed, will not score the task, will not lose their streak or take damage
- Other users will have their MP replenishment math include the done daily
- Other users "uncompleting" the daily has a bug in scoring (see [WIP] Shared completion for Group Dailies #11179 (comment) and following)
More discussion on how the feature should work may be found in #10690
I am not sure I am done with this feature, but wanted to put a draft up to start getting feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MeanderingCode thanks for the PR! I left a couple of comments about promises and callbacks but regarding the PR feature I'm going to assign it to @SabreCat since he's working on Group Plans
eb659e5
to
b16ad71
Compare
In more reworking and testing, I have discovered a bug. If UserA completes a task and UserB realizes the task is not done and "uncompletes" it, UserA's streak remains unchanged, but UserB's streak decriments. I need to look into how to avoid that. My first thought is to look into the task history property of the various copies of the task. This can only apply to Dailies, as single completion shared Todos are deleted from the other users' tasks. |
Having read more of the scoring, it looks like there are two approaches; one is messy and the other requires some careful work in https://github.com/HabitRPG/habitica/blob/develop/website/common/script/ops/scoreTask.js#L187 In the messy approach,
This is messy b/c it shows down and up scores for the "correcting" user and may not stay up to date if code changes in other areas. It would be far better to adjust Alternatively, an earlier approach I had thought of could be taken: Instead of completing the dailies on other assignedUsers' lists, simply set a startDate of tomorrow, making them grey (not due). It doesn't tell the user the task has been done (mobile apps can't see the group task board), but it does tell them they don't have to do it. In looking through code for this, it appears challenges have a lot of the features I'm looking for (though not all), and I am very curious to know more of the discussion or design thinking going into groups. I have heard of some redesign talk, but I have not been able to find anything useful in trello or github about it. @SabreCat , perhaps you have insight or can point me at where such discussion may be happening? |
There appear to be many things at play here.
I am sorry to be having a one-sided design discussion here. I continue posting as I'm learning in case someone wants to weigh in or has knowledge that may point to the right direction. |
Hello again @MeanderingCode ! I just wanted to let you know that we've not forgot about this PR and we're going to discuss it in a couple of days and let you know :) |
Hi @MeanderingCode--thanks for diving into this! A few comments and questions for you...
|
Hi @SabreCat. Thanks for taking a look! My family is very excited to have this feature, so I'd love to move this forward.
I agree it's an enhancement that's beyond this PR. I'll email about it!
I will make the cut where it makes sense. I do not want to disallow "uncompleting", because it could prove problematic if parties are relying on the status of tasks which need to get done. More below.
No, this works for both "single" and "all" shared completion types, for both completing and "uncompleting".
That echoes my own intuition and thinking, without specific knowledge of how it is used. With regards to the bug where UserB "uncompletes" a task UserA erroneously completed and the scoring/streak discrepancies, I think this can fit into an enhancement workflow around group task scoring. If UserB "uncompletes" a task UserA completed, they should be able to reverse the damage by completing the task. They won't get credit for doing it, but neither will they get damage. Leaving "uncomplete" in allows for the user who made the accidental click to rectify the mistake. With enhancements [later] for a group scoring feature, the necessary enhancements will make it easier to do things like changing the If all that is agreeable, I will finalize this PR and mark it ready for review! |
Addressed all but two linting concerns:
|
There is, indeed, a bug with approval. I will retitle this PR with "WIP". Please refrain from merging. |
…er approval to match existing behavior
Yes, the intention is that you cannot uncomplete a daily another assigned
user completed.
|
Ok then what's the point of pushing something in the task history at the
line before if it'll never be saved due to the error?
Il Lun 10 Giu 2019, 13:25 Sean Leonard <notifications@github.com> ha
scritto:
… Yes, the intention is that you cannot uncomplete a daily another assigned
user completed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11179?email_source=notifications&email_token=AAEQAV4WOV7NBVXUOFD22LDPZY2Y7A5CNFSM4HN3IP52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXJT4MQ#issuecomment-500383282>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEQAVZH5TGJ4L7EJ3PAECLPZY2Y7ANCNFSM4HN3IP5Q>
.
|
Good point. I'll remove, as well as clean up comments slightly if the
approach seems valid.
|
I had done that, as well as moved the check before the Aside: I wish GH email reply comments properly nested under the thread you started. |
The test failures were mostly due to needing to change the cron tests to async/await to match my change to the cron function. Another test (one of mine) needed to call a function for more depth regarding task completion, and one potentially good catch led to a defensive logic change for potential edge cases. |
FYI we're putting this through some QA with the help of volunteer testers from the community. @MeanderingCode you've got it tagged as WIP still--is there more you plan to implement yet? |
Hey @SabreCat. Glad to hear it! As the description states, I need to add some more tests, add history to "All" type tasks (simple), and decide when and how to cron the group dailies. If I don't cron them, the group task list dailies stay completed (though individuals' linked tasks cron with them). |
Hi @SabreCat. Any updates on how testing is going? Any bugs? I will try to write the tests soon, and am happy to push the additional things to another PR if it makes this easier. |
I checked in with the crew again today, and while no bugs have been reported, it doesn't sound like intensive testing's been done--the trials of being a small team with no dedicated QA staff, tch. We're going to set aside one of our regular meeting times to get together and try to break things in the next few days, though! |
Hi @MeanderingCode -- I committed a fix to one issue we ran across, but other than that the functionality has been working well! It might make sense to wrap up the tests here and push any further nice-to-have functionality to another PR after we merge. |
Hi @MeanderingCode, we were wondering if you plan to add the missing tests or if you need help with them! If you can't no worries and we'll add them ourselves :) thanks and let us know |
@MeanderingCode no worries, and yeah if you can post here the list of what you planned to cover it would be very useful! |
@MeanderingCode @paglias Took a stab at adding the missing group daily uncomplete at cron in 14d68e0 . Pretty first-drafty, thoughts? @MeanderingCode Getting anywhere with the checklist of tests to add?
|
left some comments! |
I'm closing this in favor of #11390 (needed because of a change in the order of PRs that will be merged) |
NOTE
this depends on #11389 now
This PR adds shared completion for Group Dailies as well as allows "uncompletion" for Group Dailies and Todos.
I am highlighting several places where I would like discussion on the feature or information on how Habitica works.
Fixes #10690
Changes
/yesterdaily
segment to the end of the task scoring route which modifies history date to user's "yesterday"__v
) toomitAttrs
insyncableAttrs
for TasksWIP / Todo
Postponed for later
UUID: 7d328dff-0f2f-4ecb-b4d4-dd323b1b676d