Closed jtmst closed 11 months ago
One thing I didn't think to ask on the SPIKE ticket: do we expect this to affect performance? (thinking: browser + 1000 events, etc)
We discussed performance and didn't think performance would be dramatically affected, especially considering the very low number of facilities that actually have more than 100 future events.
Perfect, thx!
@randimays, this ticket has been sitting in Refined for quite a while. It might be worth using a little bandwidth to try getting your head around it. (Unfortunately a spike is what led to this ticket, so I can't recommend doing another one.)
TLDR for the two below collapsed sections:
I can't reproduce any of the problems commented on #10176. Were these fixed, or do we need to find facilities for which events are displaying incorrectly?
Specific date, Date range and Past events are all working as expected. I also checked two other facilities and all 4 filters were working as expected.
I checked this page Aug 10 at 12:51 PM CST and the featured event is for tomorrow.
I checked this page Aug 10 at 12:51 PM CST and upcoming events also seem to be correct.
In the original spike (#10176), Ryan indicated that Aug 16 2022 - Aug 16 2022 shows no results. It currently shows the one event on that day.
Filtering by All upcoming shows upcoming events as expected.
Events for Aug 8 2023 filtered by Date range:
These both show in Past events:
In the original spike (#10176), Ryan K. suggested we create a React widget for handling Featured Events. This suggestion is not part of this implementation ticket. Was that intentional?
Preliminary thought is that we need to move as much time calculation as possible to the browser. For example, the "Featured Event" is currently statically generated. This will always be delayed. It should likely be converted to a React widget that can calculate event timing relative to the exact moment a veteran loads the page.
Ryan's emphasis is on moving as much time calculation as possible to the browser. I don't know right now whether we have any Facility Event code in vets-website, but is this suggesting we create a React widget for all of it?
This description in the original spike (#10176) seems to point to an entirely React solution.
"Weekend staleness" - We need to consider the implications of calculating dates during the static build, and the timing concerns of doing so. For example, we don't build over the weekend, so the content that is live on a Sunday will have been generated on Friday. This could throw off dates.
I think it'll help to name the flavors of event problems. So: https://github.com/department-of-veterans-affairs/va.gov-cms/issues/1318
Random thoughts:
Thanks @jilladams! I checked out the examples you gave this morning. The first one showing the recurring event is weird; the expectation is that a recurring event where the date has already passed wouldn't show, correct? Does the recurring part mean it happens every year on that date, every week ?? I haven't dug into the CMS to confirm.
Re: 1. - We should update the acceptance criteria in a team refinement, maybe. It still isn't totally clear to me what the outcome of this ticket should be (especially with regard to whether we're creating a React widget).
Re: 2. - I'm also not clear why we're increasing the limit. Looking at the GraphQL, it seems as though we're only fetching the first 10 future events. I'm not sure how this covers the outliers Josh referred to. I think I need more context.
I think, because this ticket is pretty stale, we need to revisit as a team and make the requirements more clear, and then we can do a deep-dive when we're actually working on this ticket. I haven't been able to reproduce many of the issues that are screenshot here or on the spike. I think we need test events and timely spelunking to make sense of this, and the picture is hazy to me because I've been doing a ton of context-switching this week.
That makes sense, and I agree.
We have a KB that covers some top-line things about recurring events: https://prod.cms.va.gov/help/cms-basics/how-to-edit-an-event#cancel-or-reschedule. Basics are you can set recurrence by week / day / month, on a specific day of the week. (You can't do complex recurrence like every 4th of the month, or every other, etc.)
Then once you have recurrences, you can modify them within the CMS:
The data for recurrences is sort of weird, and we've had to massage it a lot. Each recurrence is rooted to the original occurrence, so if, say: event recurrence is monthly on the first Monday, starting 8/1: starting 8/2, the system naturally wants to put all the recurrences in the past. So we've had to doa lot of work to help the front-end parse recurrences specifically. History of most of those changes is in this epic: https://github.com/department-of-veterans-affairs/va.gov-cms/issues/1956. Recurrences are the most fragile / brittle part of Events handling, imo.
And example recurring event you can see, here: https://staging.cms.va.gov/minneapolis-health-care/events/57181
@jilladams Thanks for the additional context, that helps. That does shed a little bit of light on expanding the events limit, though. For instance, there was a recurring event yesterday (Aug 10). If the next event takes place September 10, perhaps we aren't fetching it in the list of 10 upcoming events, so a person digging through past events would think "Ok, I see this is recurring - when is the next one?" Not sure that's the main case for expanding the limits, though.
Verified in prod that we are pulling in all events for a specific health care region. If no featured event is selected we are using the most recent event and is working as expected. Closing!
@chriskim2311 only because the verification note was specific to healthcare regions: can you confirm that the behavior applies to all Event listing pages? (e.g. Outreach Events, which isn't specific to a healthcare region.)
(Though Outreach Events don't have Featured events.)
Thanks for the comment Jill. The code changes were specific for the health care region pages and the single event that shows on those pages. Other event pages were not affected. Outreach events is working as expected and are updated based on time of day since they use a vets-website widget.
Description
Follow up to spike: https://github.com/department-of-veterans-affairs/va.gov-cms/issues/10176
Recommendations to move forward are as follows:
In order to address the event staleness issue, we need to move logic that filters out past events to the browser. Currently graphQL handles that filtering, however this only occurs on daily build. Logic needs to be added to src/site/layouts/health_care_region_page.drupal.liquid and the associated liquid.js helper file to ensure that no past events are in the data that the featured event component pulls from.
Increase the limit for future events pulled to allow for more coverage of future events by health care region. Most regions have 10 or fewer future events, but the top 10 health care regions have more. As of today, the top 3 health care regions have more than 100 future events, with the top region (puget sound health care) having 722.
Increasing the limit to 1000 gives the leeway necessary to account for these outliers. I do not recommend removing the limit entirely as a region with a large number of recurring events could result in a payload that hinders performance
Acceptance Criteria
CMS Team
Please check the team(s) that will do this work.
Program
Platform CMS Team
Sitewide Crew
⭐️ Sitewide CMS
⭐️ Public Websites
⭐️ Facilities
⭐️ User support