Skip to content

Android: open a big chat without crashing (paged, light transcript) - #376

Open
default-cybe wants to merge 1 commit into
mainfrom
fix/android-big-chat
Open

default-cybe wants to merge 1 commit into
mainfrom
fix/android-big-chat

Conversation

@default-cybe

Copy link
Copy Markdown
Owner
  • Root cause: the app read GET /api/sessions/:id/messages whole (ConclaveClient.messages), so the 1234-message chat with 89.5 MB of inline screenshots came as one JSON body. InlineImage also decoded every picture at full size.
  • Android now reads the newest 200 messages with limit=200&trim=1, the paged API the web uses since perf(hub): stall attribution, timing logs, paged web transcripts (items 1-3 of 6) #247, and reads older pages with beforeSeq when the reversed list reaches the top (OlderOnTop). This applies to both the session screen and the Chat tab.
  • A picture or document a trimmed page left out gets a conclave-block: ref (logic/Trimmed.kt). It is read from GET .../messages/:msgId/blocks/:index only when it shows, or when Edit/Retry sends it again. Retry reads it before the rewind drops the message.
  • Chat images decode at about the size they show (decodeScaled, inSampleSize) instead of full size.
  • No hub, web or CLI change. A whole read with no params behaves as before.
  • New JVM test: client/src/test/.../PagingTest.kt, covering query params, ref marking, block reads and paging back to the start.
  • Not run on a real phone yet. CI is the first Kotlin build.

The app read GET /api/sessions/:id/messages whole, so a 1234-message chat
with 89 MB of inline screenshots came as one JSON body, and every image was
decoded at full size. It now reads the newest 200 messages with trim=1 (the
paged API the web uses since #247), reads older pages with beforeSeq when the
list reaches the top, and reads a picture or document the page left out from
its block route only when it shows or Edit/Retry sends it again. Chat images
decode at about the size they show.

Committed-by: Conclave (cliproxy/personal-claude/claude-opus-5-5)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant