Files
faunosteo/.claude/tasks/contracts/2026-10-18-pdf-download-webkit-0930.md

12 lines
1.1 KiB
Markdown

# CONTRACT: PDF export download survives WebKit (hotfix)
- REQUEST (verbatim, owner brief 2026-10-18 + synthesis 2026-10-17): « Le téléchargement PDF Safari mérite un correctif indépendant avant la recette iPhone. » The URL is revoked at once (`EditorRoute.tsx:245`), which WebKit may cancel.
- ACCEPTANCE CRITERIA:
1. The PDF export download keeps its object URL alive `REVOKE_DELAY_MS` (30 s) and revokes it afterwards; it is never revoked synchronously.
2. The anchor is attached to the document while clicked, then removed.
3. File name unchanged: `bilan-${report.animal.name}-${report.date}.pdf`; Blob type `application/pdf`.
4. `downloadJson` behaviour unchanged (name `<stem>-<date>.json`, type `application/json`, 30 s revoke).
5. `pnpm --filter @faunosteo/app test:run`, `pnpm typecheck`, `pnpm lint` green.
- FILE SCOPE: `apps/app/src/lib/download.ts`, `apps/app/src/app/routes/EditorRoute.tsx`, `apps/app/tests/unit/routes.EditorRoute.export.test.tsx` (the existing case asserts the old immediate revoke and must change).
- OUT OF SCOPE: any UI change, the export engine, other object URLs (rasteriser, avatar).