Surfaced during the max-effort code review of PR #46 (default fetch-all history + device-only retention). Below the cut of the reported/fixed findings — filed for tracking.
Problem.MessageDao.lowestSyncedUid is SELECT MIN(uid) .... A row with uid <= 0 — a row migrated before the uid column existed (backfilled to 0 for a non-numeric id tail), or a fetch where UIDFolder.getUID returned -1 — makes MIN(uid) <= 0. MailBackfiller then computes beforeUid <= 0, and ImapClient.fetchOlderThan returns empty for beforeUid <= 1, so backfill treats the folder as fully paged and stops. (PR #46 guarded the analogous minWindowUid in MailSyncer; the backfiller's lowestSyncedUid was left as-is.)
Location.app/src/main/kotlin/org/libremail/data/local/dao/MessageDao.kt (lowestSyncedUid), consumed in MailBackfiller.backfillFolder.
Impact. Backfill under-fetches a folder whenever a uid <= 0 synced row is present. Often self-heals (a later foreground sync refreshes the uid), but can stall history caching until then.
Suggested fix. Scope the probe to positive uids (WHERE uid > 0), or exclude uid <= 0 rows from the boundary derivation, consistent with the minWindowUid guard.
_Surfaced during the max-effort code review of PR #46 (default fetch-all history + device-only retention). Below the cut of the reported/fixed findings — filed for tracking._
**Problem.** `MessageDao.lowestSyncedUid` is `SELECT MIN(uid) ...`. A row with `uid <= 0` — a row migrated before the `uid` column existed (backfilled to 0 for a non-numeric id tail), or a fetch where `UIDFolder.getUID` returned -1 — makes `MIN(uid) <= 0`. `MailBackfiller` then computes `beforeUid <= 0`, and `ImapClient.fetchOlderThan` returns empty for `beforeUid <= 1`, so backfill treats the folder as fully paged and stops. (PR #46 guarded the analogous `minWindowUid` in `MailSyncer`; the backfiller's `lowestSyncedUid` was left as-is.)
**Location.** `app/src/main/kotlin/org/libremail/data/local/dao/MessageDao.kt` (`lowestSyncedUid`), consumed in `MailBackfiller.backfillFolder`.
**Impact.** Backfill under-fetches a folder whenever a `uid <= 0` synced row is present. Often self-heals (a later foreground sync refreshes the uid), but can stall history caching until then.
**Suggested fix.** Scope the probe to positive uids (`WHERE uid > 0`), or exclude `uid <= 0` rows from the boundary derivation, consistent with the `minWindowUid` guard.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Surfaced during the max-effort code review of PR #46 (default fetch-all history + device-only retention). Below the cut of the reported/fixed findings — filed for tracking.
Problem.
MessageDao.lowestSyncedUidisSELECT MIN(uid) .... A row withuid <= 0— a row migrated before theuidcolumn existed (backfilled to 0 for a non-numeric id tail), or a fetch whereUIDFolder.getUIDreturned -1 — makesMIN(uid) <= 0.MailBackfillerthen computesbeforeUid <= 0, andImapClient.fetchOlderThanreturns empty forbeforeUid <= 1, so backfill treats the folder as fully paged and stops. (PR #46 guarded the analogousminWindowUidinMailSyncer; the backfiller'slowestSyncedUidwas left as-is.)Location.
app/src/main/kotlin/org/libremail/data/local/dao/MessageDao.kt(lowestSyncedUid), consumed inMailBackfiller.backfillFolder.Impact. Backfill under-fetches a folder whenever a
uid <= 0synced row is present. Often self-heals (a later foreground sync refreshes the uid), but can stall history caching until then.Suggested fix. Scope the probe to positive uids (
WHERE uid > 0), or excludeuid <= 0rows from the boundary derivation, consistent with theminWindowUidguard.