Labels: Official Campaign | FWC26 GrantFox OSS Maybe Rewarded backend privacy gdpr bug
This is a backend issue for the GrantFox FWC26 campaign. Add retention and an explicit consent scope to the tracking-pixel logging path.
Requirements and Context
backend/src/services/emailTrackingService.js — trackingPixelUrl (≈ line 37) and recordEvent (≈ line 50):
- Every email rendered via
emailRenderer.render embeds a tracking pixel (/api/emails/track/:emailId/pixel.png) whose GET records the event. The pixel logs the recipient's email-derived ID, IP, user-agent, and timestamp — PII — for every open.
- There is no retention policy on the tracking table; rows accumulate indefinitely (GDPR data-minimization/erasure concern).
recordEvent is called from sendEmail and processEmailQueue for "sent" and from the pixel for "opened"; the code has no check that the recipient has consented to open-tracking (only email delivery consent is checked via notification_email_preferences).
Objectives
- Add a retention window (e.g. 90 days) with a cleanup job that deletes old tracking rows, or anonymize IPs (store a hash + truncated IP).
- Gate open-tracking on an explicit consent flag per recipient (default off), documented in the preference API.
- Add tests: retention cleanup runs; consent-off recipients are not tracked;
isSuppressed still works after cleanup.
Suggested Execution
- Fork and branch:
git checkout -b fix/tracking-retention.
- Patch
emailTrackingService.js + add a cleanup job to backend/src/jobs/ and the cron/scheduler wiring.
- Add tests; run
npm run lint && npm test in backend/.
Acceptance Criteria
Guidelines
- Follow the project's existing data-retention patterns (
dataRetentionService.js if present); document the policy in the API docs.
Timeframe: 48 hours
Labels:
Official Campaign | FWC26GrantFox OSSMaybe RewardedbackendprivacygdprbugRequirements and Context
backend/src/services/emailTrackingService.js—trackingPixelUrl(≈ line 37) andrecordEvent(≈ line 50):emailRenderer.renderembeds a tracking pixel (/api/emails/track/:emailId/pixel.png) whose GET records the event. The pixel logs the recipient's email-derived ID, IP, user-agent, and timestamp — PII — for every open.recordEventis called fromsendEmailandprocessEmailQueuefor "sent" and from the pixel for "opened"; the code has no check that the recipient has consented to open-tracking (only email delivery consent is checked vianotification_email_preferences).Objectives
isSuppressedstill works after cleanup.Suggested Execution
git checkout -b fix/tracking-retention.emailTrackingService.js+ add a cleanup job tobackend/src/jobs/and the cron/scheduler wiring.npm run lint && npm testinbackend/.Acceptance Criteria
npm run lintclean.Guidelines
dataRetentionService.jsif present); document the policy in the API docs.Timeframe: 48 hours