Skip to content

BE-86: Implement Report Issue Intake API - #720

Open
Ahmedxnn wants to merge 6 commits into
Pulsefy:mainfrom
Ahmedxnn:feat/be-report-issue-intake
Open

BE-86: Implement Report Issue Intake API#720
Ahmedxnn wants to merge 6 commits into
Pulsefy:mainfrom
Ahmedxnn:feat/be-report-issue-intake

Conversation

@Ahmedxnn

@Ahmedxnn Ahmedxnn commented Jul 25, 2026

Copy link
Copy Markdown

Closes #653


Summary

Implements a backend Report Issue Intake API to support contributor feedback/report modal surfaces on frontend and mobile. The API stores redacted context and attachment metadata with built-in abuse prevention.

Changes Made

New Module: report-issue

  • Created complete module structure with types, DTOs, repository, service, and controller
  • Submission schema includes environment fields (platform, version, locale, timezone, screen dimensions) and reproduction steps
  • Attachment support via metadata references (actual files stored separately)

Data Privacy & Security

  • Integrated existing RedactionService to automatically redact sensitive values (API keys, tokens, passwords, emails, IPs) before persistence
  • IP addresses hashed with salt for privacy in abuse detection
  • No plaintext sensitive data stored in database

Abuse Prevention

  • IP-based rate limiting (configurable: 5 reports/hour, 20 reports/day)
  • Configurable via environment variables: REPORT_ISSUE_MAX_PER_HOUR, REPORT_ISSUE_MAX_PER_DAY, REPORT_ISSUE_HASH_SALT
  • Repository includes abuse detection methods

API Endpoints

  • POST /report-issue - Submit issue report
  • GET /report-issue/user/:userId - Get user's reports
  • GET /report-issue/admin/all - Get all reports (admin)
  • GET /report-issue/:reportId - Get specific report

Database

  • Added Supabase migration 20260725000000_create_report_issues_table.sql
  • Table includes indexes for user queries, abuse detection, and admin dashboard
  • Privacy-safe design with IP hashing and redaction support

Testing

  • Unit tests for service logic (submission, redaction, abuse limits, attachments)
  • Unit tests for DTO validation

Configuration

  • Added report issue config properties to env.schema.ts
  • Added getters to app-config.service.ts
  • Registered module in app.module.ts

Acceptance Criteria Met

  • ✅ Frontend/mobile can submit structured issue reports to the backend
  • ✅ Sensitive values are redacted before persistence
  • ✅ Abuse limits prevent spammy submissions
  • ✅ Admin retrieval support included

Files Changed

  • 17 files added, 1,475 insertions
  • New module: app/backend/src/report-issue/
  • Updated: app/backend/src/config/, app/backend/src/app.module.ts
  • Migration: app/backend/supabase/migrations/20260725000000_create_report_issues_table.sql

Testing Instructions

  1. Apply database migration: supabase db push
  2. Configure environment variables (optional - defaults provided)
  3. Test submission endpoint with valid payload
  4. Verify redaction by checking stored data
  5. Test abuse limits by exceeding hourly/daily limits

- Add report-issue module with submission schema (environment, reproduction fields)
- Implement redaction service integration for sensitive data protection
- Add IP-based abuse prevention (5/hour, 20/day limits)
- Create admin retrieval endpoints for issue reports
- Add Supabase migration for report_issues table
- Include unit tests for validation and redaction behavior
- Register module in app.module.ts and update config schema
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@Ahmedxnn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Cedarich Cedarich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly fix failed workflow

@Cedarich

Copy link
Copy Markdown
Contributor

@Ahmedxnn

@Cedarich Cedarich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove changes from backend.yml file

Thanks!

@Ahmedxnn

@Ahmedxnn
Ahmedxnn requested a review from Cedarich July 29, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BE-86: Report Issue Intake API

2 participants