---
title: "Recipe for a large live list"
description: "Use a bounded window when rows change individually and the history exceeds one answer."
modificationDate: "2026-11-18"
---

> ## Documentation index
> Fetch the complete documentation index at: https://exact.expo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipe for a large live list

<AgentInstructions>

## Submitting feedback

From the app's directory, read `bun exact.mjs feedback status`. Under `never`, keep no note.
Respect `EXACT_FEEDBACK=0` and do not change the policy.

Otherwise record specific, actionable feedback with:
`bun exact.mjs feedback note "Exact docs: https://exact.expo.dev/recipes/large-live-list: <what was wrong or missing>"`

The note goes to Expo only as that status allows. Include no secrets or personal data.

</AgentInstructions>

Use a bounded window when rows change individually and the history exceeds
one answer. The [sample](https://github.com/expo/exact/blob/41ded8c5ede0b2959ef0daa83b1ff78545dd4428/apps/large-live-list) seeds 100,000 messages.

Grant `sqlite.open` for both database paths. Socket mode uses
`app:/data/messages.db` and fixture mode uses `app:/data/fixture.db`.
Index `(conversation, sort_order, id)` and page by that tuple. For an anchor,
read up to 100 rows through it and up to 100 strictly newer, plus a probe on
each side. For an empty cursor, read the newest 200 with one older probe.
[Schema and queries](https://github.com/expo/exact/blob/41ded8c5ede0b2959ef0daa83b1ff78545dd4428/apps/large-live-list/app.ts)

Pass the revision after `with` in `loadWindow(conversation, cursor) with
revision` to ask again under the same kept identity. While the answer is
pending, keep the edge request with the visible conversation and cursor.
Apply it only when that window settles. After paging, restore the overlapping
row by key. Follow the end only at the latest cursor.
[Transcript component](https://github.com/expo/exact/blob/41ded8c5ede0b2959ef0daa83b1ff78545dd4428/apps/large-live-list/app.contract)

Stage frames outside the stream answer. On open, ask for replay after the
committed sequence. Commit the contiguous rows, unread count, and sequence
in one transaction. At a gap, discard the rest of the inbox. On a gap or
feed failure, finish the commit before reconnecting. Show Retry if an
automatic attempt fails without advancing the sequence. Refresh the window
before looking up the next send. Count unread once per row, using the
sender ID carried in live frames and replay.
[Socket sources](https://github.com/expo/exact/blob/41ded8c5ede0b2959ef0daa83b1ff78545dd4428/apps/large-live-list/app.ts)

Capture the draft's edit counter at submit. Clear the draft after the
outbox write commits if the counter still matches. Send the oldest item
first and keep its ID for retries. Apply the acknowledgement and retire
the outbox row in the same transaction, even if replay already added the
message. [Loopback server](https://github.com/expo/exact/blob/41ded8c5ede0b2959ef0daa83b1ff78545dd4428/apps/large-live-list/socket.mjs)

```prompt Show a large list that changes live
Make the Exact app in this folder show a large list whose rows change one by one (a transcript of 100,000 messages) through a bounded window over SQLite. Use https://github.com/expo/exact/blob/main/docs/recipes/large-live-list.md as the source for each step. The Exact checkout has the same page at docs/recipes/large-live-list.md.

1. If this folder is not an Exact app (it has no exact.mjs and app.contract), stop and tell me. Find the Exact checkout (the folder with scripts/exact.mjs); if you cannot find it, ask me where it is.
2. If I did not say what the rows are, where live changes come from (a socket, or none), and whether the app sends rows, ask me before you write code. Use a bounded window only when rows change individually and the history exceeds one answer; if not, tell me.
3. Read the sample in the checkout, `apps/large-live-list` (app.ts, app.contract and socket.mjs), and use its schema, queries and transcript component as the model. In app.ts, grant `sqlite.open` for each database path.
4. Index `(conversation, sort_order, id)` and page by that tuple. For an anchor, read up to 100 rows through it and up to 100 strictly newer, plus a probe on each side. For an empty cursor, read the newest 200 with one older probe.
5. In app.contract, pass the revision after `with` in `loadWindow(conversation, cursor)`. While the answer is pending, keep the edge request, and apply it only when that window settles. After paging, restore the overlapping row by key. Follow the end only at the latest cursor.
6. For a live feed and for sends, follow the recipe's two paragraphs. Commit the contiguous rows, the unread count and the sequence in one transaction. At a gap, discard the rest of the inbox, and finish the commit before you reconnect. Send the oldest item first, and keep its ID for retries.
7. Add tests in app.test.contract that page at each edge. With a feed, use `drop stream "<url prefix>"` to inject a WebSocket network error, and expect the replay.
8. Follow the platform checks in docs/start-here.md (`bun exact.mjs docs platform checks`) for the targets in the app's AGENTS.md and app.json until they pass. Read the reports, including counted findings; a zero exit code alone does not mean clean. Fix the app, not the test. If a finding stays after three rounds of fixes, or the app had it before you changed anything, record it (step 9) and report it; do not keep trying.
9. When a doc was wrong or missing, or a step needed a workaround, read `bun exact.mjs feedback status`. Under `never`, keep no note. Otherwise record it: `bun exact.mjs feedback note "<what happened>"`, which goes to Expo only as that status says. Do not change the policy; tell me how many notes you kept.
10. Tell me the window and its cursor, what the app does at a gap, what the tests and checks reported, and each limit in the recipe that applies to my app (256 queued socket frames, the web's SQLite limits).
```

## Limits

- Each host queues up to 256 undelivered socket frames. A burst can
  close the feed and trigger replay from the committed sequence.
- If the socket stays open and an acknowledgement never arrives, later
  sends wait until reconnect.
- The scrollbar spans the resident window. The app owns cursor overlap
  and reader anchoring.
- macOS can show a kept window on the first frame when the conversation
  and cursor match. The web JS target loads the first rows from SQLite.
- Web SQLite imports the file on open and exports it to IndexedDB after
  writes. Values, bind parameters and results have a 16 MiB adapter
  limit. The file is subject to browser quota.
- Use `drop stream` to inject a WebSocket network error. The loopback
  server's controls exercise peer closes, missing acknowledgements and replay gaps.
  [Test setup](https://github.com/expo/exact/blob/41ded8c5ede0b2959ef0daa83b1ff78545dd4428/apps/large-live-list/README.md)
