Habitica: [API v3] Challenges can not be edited by their owner or an admin

Created on 17 May 2016  Β·  33Comments  Β·  Source: HabitRPG/habitica

Description

Most challenge attributes cannot be edited by their owner or by admins.

Note that I'm not referring to editing the tasks that have been added to the player's own task lists. I'm talking about the challenge itself.

When a challenge owner or admin tries to edit the challenge:

  • They ARE able to change the title (this is correct).
  • They seem to be able to change the tag but on a reload, the old tag name is in place.
  • They are not able to edit the titles of the tasks - it's greyed out.
  • They are not able to change the difficulty - the buttons don't respond to clicks.

Console Errors

none

help wanted important section all section creating / editing

Most helpful comment

Ok, I think everything is done except for pushing the changes to all the users. I had a question in this part though. So right now, the functionality of challenge quests allows the user to edit the extra text on their copy of the challenge object. As we're now making it possible for the challenge owner to update the extra text field, how do we want to propagate these changes to the user?

The options I can think of are:

  • Don't allow users to modify the extra text on challenge tasks
  • Overwrite any user specific data in this field if the challenge is updated
  • don't allow the challenge owner to update this extra text field
  • allow the owner to update this extra text field but don't propagate the change to users who are already in the challenge, it will only effect users who pick up the challenge after the update is complete.

All 33 comments

Note that the challenge creator should not be able to create a checklist.

The creator (and admins) should be able to :

  • Edit the title of a task
  • Edit the extra notes (NB: the participants can also edit)
  • Change the difficulty
  • Edit the Habit's negative and positive buttons
  • Edit the repeat fields and start date for a Daily
  • Edit the due date for a To-Do
  • Add and delete tasks

@Alys except for the tag issue, the rest is disabled in v2 too

regarding the tag issue I disable it because it caused a new tag to be created on the users without removing the previous one. I would vote for not being able to change, of course the ui would have to be updated

@Alys except for the tag issue, the rest is disabled in v2 too

Oh, I'm sorry. :( I should have tested.

I would vote for not being able to change

Agreed! Leave it till after go-live if you wish. In production, even when a tag is changed, we don't want the change to be copied to existing participants (reasons in https://github.com/HabitRPG/habitrpg/issues/6974#issuecomment-204667694 ) so disabling editing works.

I don't know why the UI prevents to change title / difficulty but the API allows changes to them both in v2 and v3

I definitely think this can be ignored until later! I regret opening it. :)

I'm closing it but adding it to my list of things to revive after go-live.

I'm having the same problems both with old challenges that I own and a new one I tried to create to test. I was unable to add an additional task or change the name of an existing one within a challenge I own.

I can add notes to a to do, but not change an existing one's name or difficulty. I was able to delete a to do. I also could not add any tasks in any category. But I was able to change the name and description of the challenge.

@Memry And you used to be able to change an existing task's name or difficulty?

Yes, I could. I don’t recall messing with the difficulty very much, but I used to change the names regularly as I reorganized recurring challenges.

Hi, I'm running into these issues as well.
Challenge title, days to repeat on, "repeat every..." drop down menu, and difficulty can't be edited.

I'll try to take a look at fixing this, been as though I ran into the issue myself and need something to do but no promises as I have zero experience with your codebase.

Sorry but I'm having way too many issues with my computer (constant freezing, kernel panics) to commit to fixing this or any other issue. It's impossible to do any development work when your machine is on its way out.

I'll probably try to contribute once I get a new machine, whenever that may be.

I can take a look into fixing this. Just so I'm clear, should the changes to the challenge tasks be reflected in the users' copies of those tasks or not?

Yes, changes to a challenge's tasks should be replicated to the tasks of all participants. New tasks added to the challenge should be given to all current participants.

Are we sure the tag name should be editable? It has been explicitly left out in the code. If yes, then would all of the tags on the users' pages be changed as well?

The tags on the user's pages should not be changed, and it's okay if the tag is not editable. See my comment https://github.com/HabitRPG/habitrpg/issues/7320#issuecomment-219837082 for more details.

That is happening still for me as well. Once a challenge is saved, there's no option to add additional tasks or to change the title or difficulty of a task. I just tried it this morning, and it looked like it would add a task, but on refresh, the new task disappeared.

We really need to be able to edit existing challenges. It's too much work to re-create the challenge each time there is a small change (one new item added, for example).

I'll take a look into fixing this.

Ok, I think everything is done except for pushing the changes to all the users. I had a question in this part though. So right now, the functionality of challenge quests allows the user to edit the extra text on their copy of the challenge object. As we're now making it possible for the challenge owner to update the extra text field, how do we want to propagate these changes to the user?

The options I can think of are:

  • Don't allow users to modify the extra text on challenge tasks
  • Overwrite any user specific data in this field if the challenge is updated
  • don't allow the challenge owner to update this extra text field
  • allow the owner to update this extra text field but don't propagate the change to users who are already in the challenge, it will only effect users who pick up the challenge after the update is complete.

Of the above, I think option four is probably the best as it maintains all current functionality and doesn't overwrite any user data while still allowing the challenge owner to update the field.

I agree. Option 4 is good.

On Sun, 7 Aug 2016 5:32 am Travis, [email protected] wrote:

Of the above, I think option four is probably the best as it maintains all
current functionality and doesn't overwrite any user data while still
allowing the challenge owner to update the field.

β€”
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/HabitRPG/habitrpg/issues/7320#issuecomment-238044661,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABbTAdT52XHw5GMw3kMaSPMM4Xa7XHreks5qdOFVgaJpZM4If_jF
.

πŸ€ πŸ€ πŸ€ πŸ€ πŸ€ πŸ€ πŸ€ πŸ€ πŸ€ πŸ€

So I'm having trouble because mongoose is cutting out the some of the fields I want to update (up, down for habits, due dates for tasks, etc.) because they aren't part of the TaskSchema and are therefore being removed automatically before the update occurs. Have we handled this in a specific way in the past?

You should use the specific mongoose models for each task type. They're
exported as in models/tasks as habit/reward/todo/daily

Il 06 ago 2016 22:06, "Travis" [email protected] ha scritto:

So I'm having trouble because mongoose is cutting out the some of the
fields I want to update (up, down for habits, due dates for tasks, etc.)
because they aren't part of the TaskSchema and are therefore being removed
automatically before the update occurs. Have we handled this in a specific
way in the past?

β€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/HabitRPG/habitrpg/issues/7320#issuecomment-238046271,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAkAV8NemgeUK0__OPGP9QStSX4yjMVxks5qdOlPgaJpZM4If_jF
.

PR posted.

This still hasn't been fixed. I just tried editing an existing challenge that I created and was unable to change name or difficulty of any task within the challenge. I tried this with one I created long ago and also a test challenge I created this morning. This is true for to-do tasks. I haven't tried dailies or habits. I was able to add an additional to-do and to delete a to-do. But I can't change any that are already there.

@ShulamitLH The fix for this issue hasn't gone live yet. Issues are closed when the proposed fix has been tested, shown to work, and accepted (GitHub then closes the issues automatically in most cases), but the fix isn't necessarily deployed to the production website until a few days afterwards. You can monitor Releases page at https://github.com/HabitRPG/habitrpg/releases if you'd like to know when deployments are made to the website.

Hi @Alys I think the confusion as arisen as the release notes do say for version v3.3.20 under API

fix: edit challenges
Possibly we are waiting for a further fix under the client?

It looks like it was reverted though, the 3.31 has the green latest release label next to it.

@Hus274 is correct: we had to revert that entire release due to a bug with another PR that wasn't related to this one but that went live at the same time. That bug has been fixed now so my personal guess is that we'll redeploy soon. All admins have interrupted schedules at the moment so there's a delay until we're settled.

I'm rather confused as to whether the challenge editing bug is supposed to be fixed or not. The version now seems to be v3.33.1 and some of the editing problems have been fixed, but not all of them.

I can now edit the title of an existing task and the changes save OK (which you couldn't do before), however, I created half of a complicated challenge two days ago and now it won't let me add the To-Dos. It just says "challenge not found or you don't have access." I'm currently stuck with a half-finished challenge. :(

@Dewines Thank you for telling us! I've created a new issue for it: https://github.com/HabitRPG/habitrpg/issues/7918

Was this page helpful?
0 / 5 - 0 ratings