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

Assessments tab: Prevent errors in assessments APIs returns #23615

Merged
merged 2 commits into from Jul 11, 2018

Conversation

caleybrock
Copy link
Contributor

The errors you saw yesterday were happening because we were missing a translation and therefore couldn't select a default script. While this shouldn't happen, if it does, the APIs on the assessments tab will fail because they require a scriptId. This will prevent us from making those requests that we know will fail and instead show the UI having no assessments available.

screen shot 2018-07-10 at 10 56 20 am

@@ -73,7 +73,8 @@ export const asyncLoadAssessments = (sectionId, scriptId) => {
const state = getState().sectionAssessments;

// Don't load data if it's already stored in redux.
if (state.assessmentResponsesByScript[scriptId]) {
// Don't attempt to load data if there is not script or section selected.
if (state.assessmentResponsesByScript[scriptId] || !scriptId || !sectionId) {
Copy link
Member

Choose a reason for hiding this comment

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

apologies if this is just a nit, but the comment says "if there is not a script OR section selected" but the code appears to implement "if there is not a script AND section selected". I'm not sure which is correct, but they should probably be consistent

@caleybrock caleybrock merged commit 281eb0e into staging Jul 11, 2018
@caleybrock caleybrock deleted the prevent-assessments-errors branch July 11, 2018 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants