-
Notifications
You must be signed in to change notification settings - Fork 0
fix: debug RAB digital planning timeouts #885
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| const metadata = await getSessionMetadata(client, sessionId); | ||
| if (!metadata) | ||
| throw new Error(`Cannot get metadata for session ${sessionId}`); |
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 are the most important changes !
Previously, between getSessionById, findPublishedFlowBySessionId, and getSessionMetadata we were making THREE separate requests to the lowcal_session record for different bits of data.
Now, with an extended Session type definition, we make a single request to the session and a single request to getMostRecentPublishedFlowBeforeTimestamp.
** I haven't fully grasped all possible knock-on effects of updating the Session type beyond this change - will make sure to check this more carefully before merging.
| passport, | ||
| breadcrumbs, | ||
| govUkPayment, | ||
| session, |
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.
This is a lot cleaner now, and means we can have much more simplified mockSessions entries in model.test.ts
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.
Agreed - much simpler interface all around 👌
| import { Session } from "../../../types/session.js"; | ||
|
|
||
| // Not fee-carrying = no `data.govUkPayment` | ||
| export const mockNOCSession: Session = { |
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.
Important to note that all mocked sessions now adhere to Session type! Previously they matched the output of the /summary admin endpoint.
In addition to updating all mock session types, I also removed PriorApproval and Doncaster (replacing it with Doncaster2) - we aren't actually running prior approvals, and I think we can safely just test the most recent Doncaster pre-app payload rather than two iterations of it.
The maintenance and "fresh-ness" of mock data still a pretty big painpoint! None of our LDC mocks reflect the latest templated version for example.
| breadcrumbs: | ||
| mockReportAPlanningBreachSessionMedway.breadcrumbs as Breadcrumbs, | ||
| name: "RAB Templated - Medway", | ||
| session: mockReportAPlanningBreachSessionMedway, |
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.
Unfortunately, RAB is the only session/flow combo still failing ! Here's a screenshot of runtime on my local machine on this branch (to compare to main to see if we've cut processing time):

Next, I want to look at:
mapPassportToEnforcementPayload()- the actual RAB template flow - is there any circular logic or similar that we've missed ?? (the template now has whole PD flow nested within it, wherease many council-run services before did not)
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.
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.
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.
Having this mock was super helpful thank you - essential to pinpointing the exact issues causing the failure.
…ess/update-medway-rab-mock-data
| passport, | ||
| breadcrumbs, | ||
| govUkPayment, | ||
| session, |
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.
Agreed - much simpler interface all around 👌
| breadcrumbs: | ||
| mockReportAPlanningBreachSessionMedway.breadcrumbs as Breadcrumbs, | ||
| name: "RAB Templated - Medway", | ||
| session: mockReportAPlanningBreachSessionMedway, |
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.
Having this mock was super helpful thank you - essential to pinpointing the exact issues causing the failure.
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.
Much simpler and better to slim down these requests 👌
| ); | ||
| return response.lowcal_sessions_by_pk; | ||
| } | ||
|
|
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.
With the expanded Session type, the only remaining difference of a DetailedSession was lockedAt - so I'm opting to remove getDetailedSessionById query and $client.session.findDetails altogether in favor of a single $client.session.find ! This makes it easier to manage associated mocks in planx-new.


Daf had the better permformance fix / pin-point in #886 than here, but I think the simplified
sessionrequests and mock data setup is worth still progressing here - moreso for developer experience / improved future maintenance !