Send report packets with media links only (#138) - #120
Conversation
|
| await outboundMail.appendOutbound(id, { | ||
| body: last.body, | ||
| toAddr, | ||
| ...(subject.length > 0 ? { subject } : {}), | ||
| ...(last.html !== null ? { html: last.html } : {}), |
There was a problem hiding this comment.
Report packets store signed private-media URLs in their text and HTML. This resend path forwards those stored bodies unchanged, so a resend after the seven-day URL lifetime sends links that can no longer retrieve the report photo or video; attachments are no longer included as a fallback. Rebuild report packet links from durable media keys, or retain structured media metadata and mint fresh URLs before delivery. This must be fixed before merging.
Artifacts
Expired packet link reproduction script
- The focused script creates a private-media report packet and resends it after the modeled link expiry, demonstrating whether the stored URL is refreshed.
Expired packet link reproduction command
- The command wrapper executes the focused packet generation and resend reproduction.
Original private report packet generation
- Executed the focused service script to generate the original report packet; it shows one private-media presign from the durable key and the signed URL in the stored text body, establishing the before condition.
Resend after modeled link expiry
- Executed the focused service script to resend after the seven-day modeled expiry; it shows no refresh call and the expired signed URL remains in the resent body, confirming the defect.
Expired packet link command output
- The command completed successfully and records that the expired signed URL remained in both resent text and HTML without a refresh.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: services/api/src/services/admin/mail-service.ts
Line: 135-139
Comment:
**Refresh resend media links**
Report packets store signed private-media URLs in their text and HTML. This resend path forwards those stored bodies unchanged, so a resend after the seven-day URL lifetime sends links that can no longer retrieve the report photo or video; attachments are no longer included as a fallback. Rebuild report packet links from durable media keys, or retain structured media metadata and mint fresh URLs before delivery. This must be fixed before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Part of civfix/issue-tracker#138
What changed
A report sent to a city no longer carries its photos as email attachments. The email lists every photo and video as a link instead, so a strict mail server has nothing to block. Admin only: this changes the email the city receives, not any screen.
Before you start
Verify
[Admin]
Regression
Resend from Mail — [Admin]
Follow-up to the city — [Admin]
City replies with files — [Admin]
Not covered