-
Notifications
You must be signed in to change notification settings - Fork 17
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
Avoid VACOLS calls on already scheduled veterans page - Part 1 #13668
Conversation
@@ -4,10 +4,9 @@ class HearingSerializer | |||
include FastJsonapi::ObjectSerializer | |||
include HearingSerializerBase | |||
|
|||
attribute :aod, &:aod? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The frontend expects a field named aod
, but it wasn't being returned before for AMA hearings
}; | ||
|
||
export const getTimeInDifferentTimeZone = (date, timeZone) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing getTime
and getTimeInDifferentTimeZone
since they aren't used. I also think the server is responsible for doing a lot of the time conversions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the server converting the time to the timezone of the hearing location? What if that differs from the timezone in which the user is currently viewing Caseflow? That could lead to incorrect time displays depending on if the user is in a different TZ than the hearing, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the server converting the time to the timezone of the hearing location?
Yep, the time the server sends down is in the timezone of the regional office (although it sends the time as a string).
What if that differs from the timezone in which the user is currently viewing Caseflow? That could lead to incorrect time displays depending on if the user is in a different TZ than the hearing, right?
It always show the time in the timezone of the RO. I think this makes sense, since the people viewing this page should either be in the RO of the hearing or in the CO (users are judge, representative, or hearing coordinator). This is getting blurrier though now because hearings can be conducted across state lines.
Code Climate has analyzed commit be866fd and detected 0 issues on this pull request. View more on Code Climate. |
… data that needs to be cached
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is great — huge performance increases that should come of this, and I love that it lets us remove the artificial limit on entries returned (this likely will open up lots more possibilities for UI improvements, like fast in-browser pagination, etc).
What is the best way to test it? I was looking at it locally, but I'm not sure which regional offices are supposed to have decent amounts of seed data. Are there specs that might populate in tons of data to be able to gauge performance?
); | ||
const coTime = getDisplayTime(hearing.centralOfficeTimeString, 'America/New_York'); | ||
|
||
if (hearing.readableRequestType === 'Central') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only see a couple of differences between what's being rendered in this block and the main one... might be better to just have one return and simply add conditionals for the couple of places where they diverge?
import DocketTypeBadge from '../../../components/DocketTypeBadge'; | ||
|
||
export const HearingTime = ({ hearing, isCentralOffice }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huzzah to splitting this out into its own file!
@@ -87,7 +66,7 @@ export const HearingDocketTag = ({ hearing }) => { | |||
HearingDocketTag.propTypes = { | |||
hearing: PropTypes.shape({ | |||
docketName: PropTypes.string, | |||
docketNumber: PropTypes.string | |||
docketNumber: PropTypes.number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love fixing up PropTypes. :)
}; | ||
|
||
export const getTimeInDifferentTimeZone = (date, timeZone) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the server converting the time to the timezone of the hearing location? What if that differs from the timezone in which the user is currently viewing Caseflow? That could lead to incorrect time displays depending on if the user is in a different TZ than the hearing, right?
Unfortunately, there isn't a great way to test the performance of this locally without modifying the These RO's should have data (but probably enough to be able to gauge performance):
If you do want to go with the route of modifying Lines 288 to 317 in dcb3886
and have it fill up each hearing day, as opposed to just generating a 1-2 hearings for each day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it works locally, and seems like good code improvements in addition to GREAT performance improvements!
@@ -70,14 +70,19 @@ def warm_participant_caches | |||
|
|||
def warm_ro_participant_caches(ro_ids) | |||
start_time = Time.zone.now | |||
start_range = Time.zone.today.beginning_of_day |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own curiosity, which TZ would these be using? I haven't really looked at how we're storing/handling time data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These would be using the UTC TZ in prod. It's slightly different in UAT because we have been testing some TZ changes there.
The web server does not run under UTC, which is a whole other story 🙁
@@ -0,0 +1,12 @@ | |||
# frozen_string_literal: true | |||
|
|||
module HearingTimeConcern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good refactoring
…b.com/department-of-veterans-affairs/caseflow into ftseng-scheduled-veterans-performance
Description
Fixes some performance issues on the already scheduled veterans page that were reported to batteam
HearingTime
componentaod
is always passed to the frontend