You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Addresses isadeks's review on PR #619:
1. Zero-byte attachment → JiraAttachmentError (fail-closed). A 0-byte body
passed magic-byte + screening then tripped createAttachmentRecord's size
guard with a plain Error outside the fail-closed conversion (no ❌ comment).
Now rejected explicitly with a Jira comment.
2. 50 MB total-attachment cap enforced on REAL downloaded bytes, not the
attacker-declared `size` metadata (which can under-report). Cumulative real
bytes tracked in the download loop; throws once over the ceiling.
3. S3 orphan cleanup. downloadScreenAndStoreJiraAttachments now tracks uploaded
keys and best-effort-deletes them if the batch throws mid-way; the processor
deletes the returned pre-screened objects when createTaskCore returns non-201
(and on a 200 idempotent replay, whose objects the replayed task doesn't
reference). New exported cleanupPreScreenedAttachments helper.
4. Comment content screened SEPARATELY and dropped fail-open. Third-party
comment text that trips the guardrail no longer fails the reporter's task —
screenCommentsOrDrop screens the folded comment block and drops it (task
proceeds) on GUARDRAIL_INTERVENED / screening outage / no guardrail.
5. Deterministic idempotency key (`jira-<issueKey>-<webhookTimestamp>`) so an
async webhook re-delivery dedupes instead of minting a duplicate task and
re-downloading every attachment. A 200 idempotent replay is handled as
success (no ❌ comment), cleaning up the round's re-uploaded objects.
6. Webhook-processor timeout 60s → 300s. 10 serial 10s attachment fetches can
sum past 60s; a mid-loop kill would orphan objects and force a retry.
Tests: +5 (zero-byte reject, real-byte total cap, mid-batch orphan cleanup,
comment-blocked fail-open drop, deterministic idempotency key + 200-replay).
mise run build green (cdk 2362).
0 commit comments