zooniverse / front-end-monorepo

A rebuild of the front-end for zooniverse.org
https://www.zooniverse.org
Apache License 2.0
104 stars 30 forks source link

Task order not reflecting Lab choice + freezing workflow #5807

Open snblickhan opened 9 months ago

snblickhan commented 9 months ago

FEM

Choose from the list:

Describe the bug

3/13/24 update: This is a known PFE bug. It has a bandaid fix in PFE's classifier component, so the bug won't be an issue on PFE projects. FEM projects do not have this bandaid fix yet. For most projects, we will catch any instances of this bug at the building stage or at least during internal review/beta. Projects at risk of launching live workflows with this bug are: 1) already on FEM; and 2) have already launched and are adding new workflows without as much testing (e.g. copying a workflow).

-- A branching workflow in FEM (project ID: 21696) is at times displaying the 'Next' button when a specific task should lead to 'Submit classification and load next subject'. The 'Next' button doesn't lead anywhere and leaves the user stuck.

The project has multiple branching workflows (with identical structure), and this bug is appearing in some of them. The project owner can sometimes fix the issue by changing the 'next task' to a different task, and then changing it back to 'Submit classification and load next subject'.

From the original report (via Freshdesk ticket https://zooniverse.freshdesk.com/a/tickets/18560):

often, while testing the workflows, I pushed a button that resulted in “Submit classification and load next subject” and it didn’t work as expected: instead, the workflow would loop back to the same box, this time empty – without submitting the classification. I managed to make it work by changing the destination to some other step, and then switch back to the one but that it did not work consistently.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://frontend.preview.zooniverse.org/projects/johandmi/arctic-archives-unraveling-greenlands-weather-history/classify/workflow/25700
  2. Click on the 9pm workflow
  3. Choose the 'monthly' data format
  4. See error at step 'Aar/annee': 'Next button' doesn't lead anywhere, and is incorrectly presented (should be 'Submit classification and load next subject').

Screenshots

https://github.com/zooniverse/front-end-monorepo/assets/23665803/4004ee5a-7f9a-4597-b0a9-77b8c633c050

Expected behavior

The lab behavior is set to 'Submit classification and load next subject' for this step, which is what would be expected, not the 'Next' button

Device information

Desktop (please complete the following information):

Additional context

The project owner has ID'd a workaround for this, albeit it isn't always reliable:

a workaround that (sometimes) works: changing the Next task to some other task than “Submit classification and load next subject”, then exit the workflow, reenter, and change back to “Submit classification and load next subject”. Somehow, this fixed the issue in one of the other workflows, but it is not so practical.

snblickhan commented 9 months ago

Possibly seeing the same issue on project 20163, workflow 25006. Freshdesk ticket link.

Somehow the 'next' button doesn't work and you can't go on to the next picture, which also means it is currently not possible to actually submit a transcription. (The second workflow works without this issue.)

Note that this is a single-task workflow, not branching. I was able to replicate right away. After drawing 2 boxes and entering test transcription data, I clicked 'Next' and nothing happened. I can confirm that, in the Lab, the next step is set to 'Submit classification and load next subject'.

snblickhan commented 9 months ago

Update: on project 20163, workflow 25006, I tried the workaround that the original team described (changing the next step to a different task, then re-selecting "submit") and it seemed to work, at least temporarily. I'll ask the team to keep an eye on it and let us know if they encounter the issue again.

goplayoutside3 commented 9 months ago

An important distinction is that this bug only occurs in the FEM classifier, not the PFE classifier. I updated the project link in "How to Replicate" to https://frontend.preview.zooniverse.org/projects/johandmi/arctic-archives-unraveling-greenlands-weather-history/classify/workflow/25700

Noting that the second project mentioned is ABC's of Dialect on FEM https://frontend.preview.zooniverse.org/projects/dschopper/the-abcs-of-dialect

eatyourgreens commented 9 months ago

This sounds like a Project Builder bug that came up a couple of times during Engaging Crowds. When you delete a task, it doesn't necessarily clear task.next for the previous task.

In the broken workflow, you can see that task.next is 'T8' for the broken task (T7.) There is no task T8, so the Next button does nothing.

When a task doesn't exist, the Project Builder incorrectly shows 'Submit classification…' as the next task. I bet that's what has happened here.

Saicbmm commented 8 months ago

In regards to the freezing workflow, when I inspected the code for the done button, it seems that there is no code for the on-click activity of the done button in the monthly data workflow which should be coded in JS. Adding the code along with connecting it to the backend should fix the job.

goplayoutside3 commented 8 months ago

@eatyourgreens how did you inspect the broken workflow to see task.next? Did you look at the workflow response when viewing its project builder page in the browser tools?

I'm looking for the best way to debug here because it's confusing that the above mentioned project's workflow is broken in the FEM classifier, but NOT in the PFE classifier. I don't think anyone's been able to replicate the classifier bug in PFE yet.

eatyourgreens commented 8 months ago

how did you inspect the broken workflow to see task.next? Did you look at the workflow response when viewing its project builder page in the browser tools?

Yep, I looked at workflow.tasks in the network panel for the broken workflow. The broken task is T7, and T7.next is set to 'T8', which doesn't exist.

When you delete a task in the project builder, I don't think the workflow editor clears any references to that task key in other workflow tasks. So tasks can be left with task.next pointing to a task that doesn't exist. This bug has come up a few times before. I remember it from Engaging Crowds projects, which had some very complicated workflows.

I'm looking for the best way to debug here because it's confusing that the above mentioned project's workflow is broken in the FEM classifier, but NOT in the PFE classifier. I don't think anyone's been able to replicate the classifier bug in PFE yet.

PFE overwrites task.next with an empty string, if it points to a task key that doesn't exist. That works, but hides any bugs in the underlying workflow.tasks object. https://github.com/zooniverse/Panoptes-Front-End/blob/5e06958b45589a65c55af1f34fcfe06d717553bf/app/classifier/task-nav.jsx#L90-L92

eatyourgreens commented 8 months ago

In regards to the freezing workflow, when I inspected the code for the done button, it seems that there is no code for the on-click activity of the done button in the monthly data workflow which should be coded in JS. Adding the code along with connecting it to the backend should fix the job.

This reads like it was generated by ChatGPT.

goplayoutside3 commented 8 months ago

PFE overwrites task.next with an empty string, if it points to a task key that doesn't exist. That works, but hides any bugs in the underlying workflow.tasks object.

Thanks this helps! Sounds like it would be beneficial to make the fix in the workflow editor and that FEM's classifier is doing its job even though T8 doesn't exist.

goplayoutside3 commented 8 months ago

Actually, several of the editor files in the project builder are written in coffeescript 😬 I might favor adding the same nextTaskKey = '' safeguard to FEM's classifier noting that FEM is getting a new "pages editor" in which we can make sure not to replicate the same task deletion bug.

@eatyourgreens did you look into how to change the current project builder so the task editor clears any references to a deleted task key in other tasks? (when encountered in Engaging Crowds work)

eatyourgreens commented 8 months ago

I haven't looked into it, but this is the function that removes a task from a workflow.

https://github.com/zooniverse/Panoptes-Front-End/blob/5e06958b45589a65c55af1f34fcfe06d717553bf/app/pages/lab/workflow.jsx#L797-L814

snblickhan commented 6 months ago

Davy Notebooks Project experienced this issue. They copied an existing workflow and deleted one task from the workflow. When they launched, the last task in the new workflow showed the 'Next' button instead of 'Done', so the workflow couldn't move ahead.

Talk report: https://www.zooniverse.org/projects/humphrydavy/davy-notebooks-project/talk/2586/3292582?page=1&scrollToLastComment=true

I fixed the issue by changing the ordering for the last task from 'Submit' to another task in the workflow, then changing it BACK to 'Submit'. After this, the workflow performed as expected.

Why this is an edge case:

eatyourgreens commented 3 months ago

https://github.com/zooniverse/Panoptes-Front-End/pull/7099 will fix this by removing dangling task keys, when you delete a task in the Project Builder.