apo5698/helli-grading

Grading page tags select default key inconsistently every time

Closed this issue · 0 comments

Describe the bug

Grading page tags select default key inconsistently every time.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Automated Grading'
  2. Refresh the page several times

Expected behavior

  • The subtitle should always match the tag title
  • The first rubric item should always be selected

Screenshots

FireShot Capture 003 - Automated Grading - Helli Dev - helli app

Desktop

  • OS: macOS 11.1 (20C69)
  • Browser: Google Chrome
  • Version: 88.0.4324.96

Additional context

Possible cause

The default active tag key is defined as

https://github.com/apo5698/helli/blob/c2805396d9de0b4e2ac565f8026e09ae5c71bb72/app/javascript/components/grading/v2/Page.tsx#L329

where currentRubricItemId is set by

https://github.com/apo5698/helli/blob/c2805396d9de0b4e2ac565f8026e09ae5c71bb72/app/javascript/components/grading/v2/Page.tsx#L113

However, the order of execution of the async function getHelliApi() is not guaranteed

https://github.com/apo5698/helli/blob/c2805396d9de0b4e2ac565f8026e09ae5c71bb72/app/javascript/components/grading/v2/Page.tsx#L149-L156