/
2024-12-17 Form R PDFs blank

2024-12-17 Form R PDFs blank

Date

Dec 17, 2024

Authors

@Andy Dingley

Status

Done

Summary

Client-side downloaded PDFs such as Form Rs were being downloaded as multi-page blank documents

Impact

Trainees were unable to download copies of their forms.

Non-technical Description

The current “Save as PDF” approach for FormRs uses the client/browser to “print” the current page to a PDF document, this was a quick and easy implementation to solve an immediate issue but it is reliant on the consistency of the user’s device and browser.

One big downside to this approach is it is very easy to include additional elements from the page that the user would not want to see, such as

  • Feedback/support prompts

  • “Alert” banners for outstanding actions

  • Page URLs

image-20241223-164002.png

There are two parallel efforts to avoid this sort of behaviour.

The first is moving PDF generation to happen on the server instead of on the user’s device, this gives us much more control over the appearance and consistency. This is currently in place for Conditions of Joining and Programme Confirmation but not FormR.

The second, is to improve the generation of PDFs where we still need/want it to be done on the user’s device. For CCT calculator exports we tried a new technique to hide unwanted parts of the website before printing the “page”.
Unfortunately, “unwanted parts” was not well defined and it led to the whole FormR contents being hidden before creating the PDF.

The hiding approach has been reverted until we can ensure we do not create any further side-effects.


Trigger

A tis-trainee-ui change was deployed for CCT calculation printing, which included CSS to hide “unwanted” elements.


Detection

Reported by users, highlighted the TSS team on slack.


5 Whys (or other analysis of Root Cause)

  • FormR pdf content was hidden

  • CSS was applied which designated the FormR contents as unwanted

  • CSS added for CCT Calculation printing affected FormR

  • Lack of regression testing/integration tests for printed content

  • Difficult to automate


Resolution

  • CSS was removed to revert FormR back to previous working state


Timeline

All times GMT unless otherwise indicated.

  • Dec 13, 202415:15 - CCT Calculator merge to main

  • Dec 16, 202417:02 - New deployment pushed to production

  • Dec 17, 202410:14 - Issue brought to trainee team’s attention via Slack

  • Dec 17, 202411:12 - Probable cause identified

  • Dec 17, 202412:07 - Attempts to fix the FormR to use the new functionality is abandoned

  • Dec 17, 202412:14 - Reversion of the CSS changes submitted as a fix

  • Dec 17, 202412:58 - Fix deployed


Action Items

Action Items

Owner

 

Action Items

Owner

 

 

 

 

 

 

 

 

 

 

See also:


Lessons Learned

  •