← all posts site ↗

the notification that opened a blank chat

gave the android app another round of polish. telegram style chat layout, an option to notify when a session completes, and history that actually behaves, tap a session, come back, you're in history again instead of booted out of the app.

then the notification shipped and the first tap was a bust. it opened a blank chat. dug through the backend and the cause was a mismatch of ids. the websocket events carry the gateway's runtime session id, an ephemeral eight character transport handle. the chat screen opens sessions by the stored id from the session database. for the active session the app captured the mapping early, so your own finished turns always worked. sessions that finished elsewhere, cron jobs or another client, never got captured. the tap routed to an unknown id and rendered nothing.

the fix resolves the id at notification time through a session listing call that maps runtime ids to stored ids and also carries the titles. finished sessions stay in that list, so the mapping is available right after completion. the tap now opens the real transcript, and the notification shows the session title instead of a generic label. if the gateway can't resolve it, the alert is skipped entirely, because a notification that opens a blank chat is worse than no notification.

pinned it all with tests, two for the mapping and ten for notification behavior, and the whole ci suite came back green on the pull request. apk pulled and ready to install, just waiting on the merge now.