Repository navigation
fix: show receipt when the instance has no data elements left - #4414
Conversation
When every data type (including ref-data-as-pdf and attachments) is configured with appLogic.autoDeleteOnProcessEnd, the instance has no data elements once the process ends. ReceiptContainer treated an empty data list as "not loaded yet" and rendered the skeleton loader forever (reason: receipt-missing-attachments). Wait only for the instance query to resolve, and treat an empty list as no attachments.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
/publish |
PR release:
|
|
✅ Automatic backport successful! A backport PR has been automatically created for the The release branch The cherry-pick was clean with no conflicts. Please review the backport PR when it appears. |
Description
The receipt page got stuck on the skeleton loader (reason
receipt-missing-attachments) when an instance had no data elements left after the process ended. This happens when every data type, includingref-data-as-pdfand attachments, is configured withappLogic.autoDeleteOnProcessEnd: the backend deletes the elements at process end, Storage hides them from the end user, and the instance is returned with an emptydatalist.ReceiptContainertreated an emptydatalist as "instance not loaded yet" and never rendered the receipt. It now only waits for the instance query to resolve and treats an empty list as "no attachments". Both the full and the simple receipt render as before when attachments or a PDF exist.For service owners: apps that auto-delete all data types at process end now show the receipt page instead of a never-ending loading state.
Slack thread: https://digdir-samarbeid.slack.com/archives/C02EJ9HKQA3/p1794842550350119
Related Issue(s)
Verification/QA
kind/*andbackport*label to this PR for proper release notes groupingHow it was verified
Two new unit tests in
ReceiptContainer.test.tsxrender the receipt with an instance whosedatalist is empty, with and withoutautoDeleteOnProcessEndon the instance level. Without the fix both fail after the 15 s wait withExpected to not be loading, but was loading because of 'receipt-missing-attachments'. With the fix all six tests in the file pass.eslint,prettier --checkandtsc --noEmitare clean.Browser verification is not possible in the environment this was developed in, so the service owner should verify in TT02 once released.
🤖 Generated with Claude Code
Summary by CodeRabbit