Source: perf audit of the Paging 3 usage (finding #3).
Issue #124 paged the unified "All inboxes" browse list, but the per-account folder view and all search paths are still not paged — they load the whole folder / entire unified inbox into memory:
Per-account folder browse:MailboxViewModel.messages (app/src/main/kotlin/org/libremail/ui/mailbox/MailboxViewModel.kt:128) via observeFolderMessages → rendered as items(messages, key = { it.id }) (MailboxScreen.kt:348). Loads the entire folder as List<Message>.
Unified search:observeUnifiedFolderSummaries (app/src/main/kotlin/org/libremail/data/local/dao/MessageDao.kt:52) — its own KDoc notes it "materializes the entire unified inbox (~thousands of rows) on every emission."
Per-account search: same whole-folder path.
This re-introduces the whole-list-in-memory cost that #124 removed, the moment the user switches to a single account or runs a search.
Fix: add a Room PagingSource variant for the per-account folder (mirroring pagingUnifiedFolderSummaries in MessageDao), plus a paged/limited search, and wire them through MailboxViewModel + MailboxScreen the same way the unified browse list is paged. Reuse the shared PagingConfig (see #1). Keep the lazy keys and the load-state handling consistent with the unified list.
**Source:** perf audit of the Paging 3 usage (finding #3).
Issue #124 paged the unified "All inboxes" browse list, but the **per-account folder view and all search paths are still not paged** — they load the whole folder / entire unified inbox into memory:
- **Per-account folder browse:** `MailboxViewModel.messages` (`app/src/main/kotlin/org/libremail/ui/mailbox/MailboxViewModel.kt:128`) via `observeFolderMessages` → rendered as `items(messages, key = { it.id })` (`MailboxScreen.kt:348`). Loads the entire folder as `List<Message>`.
- **Unified search:** `observeUnifiedFolderSummaries` (`app/src/main/kotlin/org/libremail/data/local/dao/MessageDao.kt:52`) — its own KDoc notes it "materializes the *entire* unified inbox (~thousands of rows) on every emission."
- **Per-account search:** same whole-folder path.
This re-introduces the whole-list-in-memory cost that #124 removed, the moment the user switches to a single account or runs a search.
**Fix:** add a Room `PagingSource` variant for the per-account folder (mirroring `pagingUnifiedFolderSummaries` in `MessageDao`), plus a paged/limited search, and wire them through `MailboxViewModel` + `MailboxScreen` the same way the unified browse list is paged. Reuse the shared `PagingConfig` (see #1). Keep the lazy `key`s and the load-state handling consistent with the unified list.
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.
Source: perf audit of the Paging 3 usage (finding #3).
Issue #124 paged the unified "All inboxes" browse list, but the per-account folder view and all search paths are still not paged — they load the whole folder / entire unified inbox into memory:
MailboxViewModel.messages(app/src/main/kotlin/org/libremail/ui/mailbox/MailboxViewModel.kt:128) viaobserveFolderMessages→ rendered asitems(messages, key = { it.id })(MailboxScreen.kt:348). Loads the entire folder asList<Message>.observeUnifiedFolderSummaries(app/src/main/kotlin/org/libremail/data/local/dao/MessageDao.kt:52) — its own KDoc notes it "materializes the entire unified inbox (~thousands of rows) on every emission."This re-introduces the whole-list-in-memory cost that #124 removed, the moment the user switches to a single account or runs a search.
Fix: add a Room
PagingSourcevariant for the per-account folder (mirroringpagingUnifiedFolderSummariesinMessageDao), plus a paged/limited search, and wire them throughMailboxViewModel+MailboxScreenthe same way the unified browse list is paged. Reuse the sharedPagingConfig(see #1). Keep the lazykeys and the load-state handling consistent with the unified list.