Android: opening a session crashes the app

Offen
#239 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
22/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
android, kotlin
Bereich
mobile-dev

Rechercherichtung

The crash happens when opening a non-archived session from Home, so start with the Home transcript cache, prefetch, and unread-anchor code that runs on open, not the message renderer. Reproduce with a session of about 437 messages on an Android device, capture logcat -b crash for the failing open, and check whether the unread anchor points outside the loaded limit=30 window. Done means the session opens from Home without crashing and a regression check covers that path.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Summary

Opening one specific session crashes the Android app immediately. The same session opens fine on iOS. Every other session on the same Android install opens fine.

Archiving the session makes it open normally from the Archived page, with the exact same server payload. So the crash is not in the message content; it looks tied to the non-archived open path (Home transcript cache / unread positioning / Catch Up).

Environment

  • App: 0.8.4 (Android)
  • Device: Lenovo Pad, Android 13 (tablet)
  • Server: opencode 2.3.2, V2 contract
  • Session: ~437 messages, ~1.2 MB

Steps

  1. Pair the app with the server.
  2. Tap the affected session from Home.
  3. The app closes immediately (no error screen).

Expected

Session opens and shows the latest replies.

Actual

Instant crash from Home. Other sessions open normally. iOS opens the affected session without problems.

Key observation: archiving fixes it

After archiving the session, opening it from the Archived page works normally.

Reverse-proxy logs show the app requested the same endpoint before and after archiving:

  • before archive: GET /api/session/<id>/message?order=desc&limit=30 → 18397 bytes
  • after archive: GET /api/session/<id>/message?order=desc&limit=30 → 18397 bytes (identical)
  • after archive the app also paged older history: GET /api/session/<id>/message?limit=80&cursor=… → 73095 bytes, rendered fine

The archived session's newest 30 messages include the two assistant replies with Markdown tables and the 1090-char single-line tool output. They render fine in that path, so the content is not the trigger.

Hypothesis

Non-archived sessions are in Home's prefetch/cache, Catch Up and unread/new-message tracking. Archived sessions are excluded from all of those, so they open with a clean load of limit=30.

This points at the Home transcript cache or the unread-anchor logic during opening (possibly positioning on a message outside the loaded window), not at message rendering.

Ask

If useful, I can bisect further and capture logcat -b crash for the failing open. Happy to provide the full /api/session/<id>/message?order=desc&limit=30 response (sanitized) if you want to reproduce.

Vorherrschende Sprache
Kotlin
Sterne
146
Forks
35
Ø Merge
7 Std. 41 Min.
Gemergte PRs (30 T.)
221

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus anomalyco/opencode-android

Alle Issues in anomalyco/opencode-android

Ähnliche Issues

Weitere Issues zu Kotlin

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.