Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditional check to ensure resource exists before rendering report page #11843

Conversation

marcellamaki
Copy link
Member

Summary

Adds a check to ensure that resource which is necessary to render the page fully, exists in the state before it renders. This prevents the "missing resource" from appearing when the resource does exist.

References

Fixes #11824

Screenshot
Before coach-report-before
After updated-coach-report

Reviewer guidance

Do I need to do some other sort of more robust error handling here in case the resource does not in fact exist on the device and missing resource alert is more appropriate @rtibbles ? (coreLoading does not work as a condition)

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Feb 7, 2024
@marcellamaki marcellamaki added TODO: needs review Waiting for review P0 - critical Priority: Release blocker or regression and removed APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Feb 7, 2024
@rtibbles
Copy link
Member

rtibbles commented Feb 7, 2024

I don't think so - this page shouldn't even be linked to in the case that the resource is completely missing (even metadata), so it doesn't seem like a problem.

Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it fixes it - did you try doing the conditionality inside the ReportsResourceHeader instead? That might be a more general fix, as I think that's where the missing resource flag is displayed.

@marcellamaki
Copy link
Member Author

Good idea - I will make that switch

@radinamatic
Copy link
Member

Sorry to say that the current EXE asset does not seem to solve the issue on the same Windows 7 VM where it was originally reported. I'm still seeing all the issues listed there.

loading4C16GB-11843.mp4

I installed the EXE asset from this PR, and imported the same facility from the original issue (home folder from this installation).

@pcenov Could you re-test to confirm? Thank you!

@pcenov
Copy link
Member

pcenov commented Feb 8, 2024

Yes I am able to replicate the issue on Chrome(Ubuntu) specifically when viewing the Difficult questions. It's not always happening, but can be reliably replicated if you manually refresh the page:

2024-02-08_11-26-33.mp4

@marcellamaki marcellamaki force-pushed the coach-report-loading-state branch from 9605a61 to f1a6b03 Compare February 8, 2024 14:40
@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Feb 8, 2024
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right change to distinguish between the resource availability being false and just being falsy by dint of its absence.

@rtibbles
Copy link
Member

rtibbles commented Feb 8, 2024

Manual testing confirms the fix for the missing resource banner.

The NaN B remains, but that seems like a lower priority issue that can be separated out to be addressed with other extant lower priority coach loading state issues.

@radinamatic
Copy link
Member

So this latest asset does not display the Resource not found on device, but there is a delay in displaying the resource title so it seems as if it has been replaced by a blank space... 🤔

As mentioned, the NaN is still there, but as a minor thing we can deal with it separately. However, what is also still extant is the flash of the previously loaded need-help exercise title, before the current one displays.

loading4C16GB-11843b.mp4

Copy link
Member

@radinamatic radinamatic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After speaking with @marcellamaki, we decided to merge this as-is, and I'll open separate issues for the remaining 2 loading states hick-ups.

@rtibbles rtibbles merged commit b46cbb5 into learningequality:release-v0.16.x Feb 9, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend P0 - critical Priority: Release blocker or regression SIZE: very small TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants