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
- Update
get_scan_history in imap_store.py to accept an offset parameter and append OFFSET ? to the SQLite query.
- Update the
/imap/scan-results route in api.py to accept a page query parameter, calculate the offset, and pass it down.
Component: Backend / API
Files Affected:
backend/api.py,backend/email_connectors/imap_store.pyDescription
The
/imap/scan-resultsendpoint fetches historical email scan data using a hardcodedlimit=100, but there is no mechanism for anoffsetor 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
get_scan_historyinimap_store.pyto accept anoffsetparameter and appendOFFSET ?to the SQLite query./imap/scan-resultsroute inapi.pyto accept apagequery parameter, calculate theoffset, and pass it down.