Skip to content

No Pagination for IMAP Scan History #244

Description

@devprashant19

Component: Backend / API
Files Affected: backend/api.py, backend/email_connectors/imap_store.py

Description

The /imap/scan-results endpoint fetches historical email scan data using a hardcoded limit=100, but there is no mechanism for an offset or pagination. As the database grows and users accumulate thousands of scanned emails, they will only ever be able to retrieve and view the 100 most recent items. Older database records effectively become "dark data" inaccessible via the UI.

Proposed Fix

  1. Update get_scan_history in imap_store.py to accept an offset parameter and append OFFSET ? to the SQLite query.
  2. Update the /imap/scan-results route in api.py to accept a page query parameter, calculate the offset, and pass it down.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions