Skip to content

fix: revoke blob URLs after vendor dashboard CSV export #73

Description

@EmeditWeb

Problem

In VendorDashboard.tsx (lines 447-460), the CSV export function creates a blob URL (window.URL.createObjectURL(blob)) but never calls revokeObjectURL() to release it. If the component unmounts before the user triggers the download, the blob URL leaks memory.

User impact: No visible user impact per se, but repeated CSV exports will accumulate unreleased blob URLs in memory.

Root Cause

The cleanup step was omitted during development.

What To Build

  1. Store blob URL in a ref
  2. Add useEffect cleanup that calls revokeObjectURL() on unmount
  3. Alternatively, use a download approach that auto-releases after download

Files To Touch

  • src/pages/VendorDashboard.tsx — lines 447-460 add cleanup

Acceptance Criteria

  • Blob URL revoked after download or on component unmount
  • No memory leak on repeated CSV exports
  • Download still works correctly

Mandatory Checks

  • context/ files read
  • npm run build passes
  • PR references this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions