HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.
https://habitica.com
Other
12.02k stars 4.1k forks source link

People joining the challenge are not appearing in the order they joined #7721

Open cTheDragons opened 8 years ago

cTheDragons commented 8 years ago

General Info

bc10ec41-4213-4482-bbb8-558e3c3ea8d5 Opera 37.0.2178.43 Windows 8.1 32-bit

Description

In API2, you could determine when a user joined a challenge by the order they appear on the list. Now it is difficult to determine who are the late comers are, without keeping a list outside Habitica.

Thanks

Alys commented 8 years ago

This feature (or any other feature that provides similar data) is important for judging how long a participant has been doing the challenge tasks and/or how quickly they have ticked off the To-Dos.

crookedneighbor commented 8 years ago

The user's challenge tasks should have a dateCreated attribute which would be the date they joined the challenge. Might just be a matter of exposing that info.

paglias commented 8 years ago

That would require to load all the tasks for each member

khipkin commented 8 years ago

Instead of loading all tasks for each member every time:

crookedneighbor commented 8 years ago

Unfortunately, it's not that easy. user.challenges is an Array of challenge ids. To do what you propose, it'd need to be an Array of Objects, which would be a breaking change for any integration that displays a user's challenges.

So, to do what you propose, we'd also have to transform the Array of Objects back to an Array of ids whenever someone requested the user object to maintain backwards compatibility.

khipkin commented 8 years ago

Hmmm... I see. What about adding a new field user.challengesDateJoined (or something more succinct) that maps challenge ids to date strings?

crookedneighbor commented 8 years ago

I'd rather not. Probably the best course of action would be to have a new property. Something like user.challengesJoined that would be an object:

{
  'some-challenge-id': {
    dateJoined: DATE,
    otherProp: 'foo'
  },
  'some-other-challenge-id': {
    dateJoined: DATE,
    otherProp: 'foo'
  }
}

And then for backwards compatibility, user.challenges would be computed by looping over it and creating an array of ids.

librarianmage commented 7 years ago

Is this still a desired fix?

lemoness commented 7 years ago

I believe so, unless there's a technical reason that we wouldn't want to do this!

lemoness commented 7 years ago

I've updated the labels on this issue.

cTheDragons commented 7 years ago

It should be noted that this information is available in the Challenge Data Tool now

TheHollidayInn commented 7 years ago

@cTheDragons How does the Challenge Data Tool track this info?

cTheDragons commented 7 years ago

The Challenge Data Tool uses the dates of when the task was created for each user and takes the earliest of when the the challenger joined the challenge.

Tressley commented 4 years ago

Closing this for now as Challenge participants can be sorted by join date.

Doh. Alys caught my mistake. 😄

Alys commented 4 years ago

That join date sort is actually the date they joined Habitica. :) Knowing when they joined the challenge is what's needed to accurately judge the participants' progress.

cTheDragons commented 4 years ago

It should be noted that the Challenge Data Tool does show when the task was created for the person. However it not the same as the person join the challenge. (As task may be added throughout the challenge) And as noted earlier you do need to load all the tasks. (Which in the challenge data tool makes sense).