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

Davy Notebooks crashes when you change workflow #2799

Closed eatyourgreens closed 2 years ago

eatyourgreens commented 2 years ago

Package

lib-classifier

Describe the bug

Davy Notebooks crashes the classifier if you change workflow after visiting Talk.

Application error: a client-side exception has occurred (see the browser console for more information).

The error in the browser console is:

[mobx] uncaught error in 'Reaction[Autorun]' Error: [mobx-state-tree] Failed to resolve reference 'ckzcsioky00052a6owot7r8hj' to type '(DataVisAnnotation | DrawingAnnotation | MultipleChoiceAnnotation | SimpleDropdownAnnotation | SingleChoiceAnnotation | SubjectGroupComparisonAnnotation | SurveyAnnotation | TextAnnotation | TranscriptionAnnotation)' (from node: /subjects/resources/68872134/stepHistory/steps/ckzcsiol100072a6ook74zkoc/annotations/0)

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://www.zooniverse.org/projects/humphrydavy/davy-notebooks-project?demo=true
  2. Choose a workflow and classify a page.
  3. Choose Done & Talk.
  4. Go back to the classifier.
  5. Go back to the home page and choose a different workflow.

Applicable Panoptes resource IDs (project, workflow, etc) to demonstrate the issue:

Expected behavior

The page shouldn't crash.

Additional context

I think what's happening here is that snapshots of subject.stepHistory are being saved in session storage, but step history contains references to annotations, which will break when the snapshot is applied to the store on classifier load.

eatyourgreens commented 2 years ago

2793 adds extra logging info to the console, to help debug this. #2800 should fix crashes caused by missing annotations, or transcription reductions.