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

Handle undefined attorney in app/queue/AssignedCasesPage.jsx #12999

Closed
yoomlam opened this issue Dec 17, 2019 · 13 comments · Fixed by #14176
Closed

Handle undefined attorney in app/queue/AssignedCasesPage.jsx #12999

yoomlam opened this issue Dec 17, 2019 · 13 comments · Fixed by #14176
Assignees
Labels
Priority: Low Reported issue, not a blocker. "Last in" priority for new work. Product: caseflow-queue Source: Sentry Alert created because of a Sentry alert Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests Team: Echo 🐬

Comments

@yoomlam
Copy link
Contributor

yoomlam commented Dec 17, 2019

Description

In app/queue/AssignedCasesPage.jsx , an error occurs when an attorney is not found and thus is undefined. Handle this case better: app/queue/AssignedCasesPage in full_name: Cannot read property 'full_name' of undefined

Background/context/resources

During Bat Teaming, Sentry alert occurred: https://dsva.slack.com/archives/CLRTL92TW/p1576600351014300

Sentry alert: https://sentry.ds.va.gov/department-of-veterans-affairs/caseflow/issues/7605/

Technical notes

const attorneyName = attorneysOfJudge.filter((attorney) => attorney.id.toString() === attorneyId)[0].full_name;

initiated by ./app/queue/QueueActions.js in dispatch at line 372

@jimruggiero jimruggiero added the Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests label Jan 23, 2020
@hschallhorn
Copy link
Contributor

What is this graph?

1 | 
2 | ||||||||||
3 | ||||
5 | 
8 |  

Timebox this to a two as it has only occurred twice to a couple of users.

@jimruggiero jimruggiero added the Priority: Low Reported issue, not a blocker. "Last in" priority for new work. label Jan 23, 2020
@jcq
Copy link
Contributor

jcq commented Apr 23, 2020

https://sentry.ds.va.gov/department-of-veterans-affairs/caseflow/issues/8849/

FYI, while this issue is marked as low priority, it is preventing me from loading the case assignment page mentioned in that sentry alert. I assume this is likely a large issue for that particular user.

If you like shiny new things, this might be a good candidate for using the optional chaining and/or nullish coalescing operators.

@hschallhorn
Copy link
Contributor

Prioritize'd! Thanks for bringing this up!

@yoomlam
Copy link
Contributor Author

yoomlam commented May 4, 2020

I'm able to replicate and see the error in the console by going to an acting judge (who doesn't have attorneys) and manually entering http://localhost:3000/queue/BVAACTING/assign/88 (the resulting page is blank). I can also replicate as a judge trying to view an attorney who is not on my team by manually changing the URL: http://localhost:3000/queue/BVAAABSHIRE/assign/92.

@jcq Can you describe how I can replicate the error you described as:

it is preventing me from loading the case assignment page mentioned in that sentry alert.

Looking at all of these Sentry alerts, it seems like the user must be modifying or pasting the URL because none of the attorney links on the side panel corresponds to the URLs trying to be reached.

@yoomlam
Copy link
Contributor Author

yoomlam commented May 5, 2020

BEFORE AFTER PR
image (blank screen; unhandled error in devtools) image

@hschallhorn
Copy link
Contributor

Based on the breadcrumbs of these alerts it looks like this could be a stale link the user has bookmarked?

Clicking the link on the judge assign page Modifying the url
Screen Shot 2020-05-05 at 4 28 57 PM Screen Shot 2020-05-05 at 4 29 13 PM
+ 88
+ tasks?user_id=3&role=Judge
+ 3
+ users?role=Attorney
+ users?role=Attorney&judge_id=3
+ BVAAABSHIRE
88?role=judge
tasks?user_id=88&role=attorney
BVAEERDMAN?role=judge

@jcq
Copy link
Contributor

jcq commented May 5, 2020

@jcq Can you describe how I can replicate the error you described as:

it is preventing me from loading the case assignment page mentioned in that sentry alert.

Sorry, missed this until now. That said, it looks like Yoom identified the issue in the intervening time, as your before/after shots demonstrate. The "before" shot shows the issue I encountered as that user.

@hschallhorn
Copy link
Contributor

I agree that we should handle this more gracefully, but I'm not sure the judge being unable to access this page is a concern. The attorney is not on their team, so they should not be able to see the attorney's cases.

@yoomlam
Copy link
Contributor Author

yoomlam commented May 5, 2020

My PR will restrict judges from viewing other judge's assign queue. Once we enable the CM (case movement) feature flag (:scm_view_judge_assign_queue), then CM users will be able to view any judge's assign queue.

Ann-Marie sent a note to the Board noting that we are fixing the bug (judge's being able to see other JudgeTeam's assign queue).

complete convo

@hschallhorn
Copy link
Contributor

hschallhorn commented May 5, 2020

I didn't realize these were related. We confirmed that a judge viewing another judge's queue is what is causing the error? I don't have any errors showing in this scenario

Random attorney viewing a judge assign queue with scm_view_judge_assign_queue turned off (as it is in production)

Screen Shot 2020-05-05 at 5 33 34 PM

Random attorney viewing an attorney's queue within a judge assigmn queue with scm_view_judge_assign_queue turned off (as it is in production)

Screen Shot 2020-05-05 at 5 33 47 PM

@yoomlam
Copy link
Contributor Author

yoomlam commented May 5, 2020

I was able recreate error by logging in as judges as described in prior comment. I did not test when logged in as an attorney.

So back on the master branch, I test as an attorney.
Logging in as BVASCASPER1 (who is in JudgeTeam BVAOSCHOWALT), I go to
http://localhost:3000/queue/BVAGSPORER/assign/92 and get the 403 status from the tasks_controller but the page is not blank:
image

When I go to http://localhost:3000/queue/BVAAABSHIRE/assign/92, I don't get the 403 status, but the page is blank:
image

Feature flag scm_view_judge_assign_queue is not active:
image


On the PR branch and logged in as BVASCASPER1, I get this error page for those two URLs:
image

@yoomlam
Copy link
Contributor Author

yoomlam commented May 6, 2020

Updated error message:

BEFORE AFTER
image (blank screen; unhandled error in devtools) image (Atty 92 is not part of BVAAABSHIRE's JudgeTeam), image (Atty 92 is part of BVAGSPORER's JudgeTeam, which BVAAABSHIRE is not a part of)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Reported issue, not a blocker. "Last in" priority for new work. Product: caseflow-queue Source: Sentry Alert created because of a Sentry alert Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests Team: Echo 🐬
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants