Repository navigation
Mark a conversation read only while the person can see it, and whenever a run in it ends - #2192
Conversation
…er a run in it ends A conversation open in a window behind others, or in OpenBot Desktop while the person is away, was marked read the moment a reply arrived, so the server could not tell an answer they walked away from from one they watched. It is now marked read only while OpenBot is in front of them, and once they come back. A run's end marks the open conversation read too, however it ended. Before, only activity the roster heard of did: a failed run, a card with no words, and any run in a task's thread (which has no row in the list) left the conversation looking unseen while the person watched it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
guidovizoso
left a comment
There was a problem hiding this comment.
The change does what it says: read only while OpenBot is in sight, and on every run end the chat sees, with or without a row in the roster. The three new tests cover those cases.
Two gaps inline, both about a person being told on their phone about something they are reading, or not told about something they did not see.
Smaller notes, no change needed:
- An answered run now sends two mark-reads (the run end, then the roster hearing the reply), and each intermediate run that ends on a browser tool sends one. Harmless, only more requests.
- CI:
format, lint, typesfails on two SVGs underdocs/assets, which this PR does not touch.
… at the moment of marking From review: - An open marks the conversation read even when the roster says nothing is unseen. A run that ended while the person was in another conversation (a failed one, one that ended on a card with no words, any run in a task's thread) never reaches the roster, so reopening it left it unread while they read it. This also covers a route that switches conversation without remounting. - Whether OpenBot is in sight is asked when the mark is made, not taken from the last focus event. With focus inside a frame, switching apps sends this window nothing. A mark owed while out of sight checks again every second. - The mark on open waits for the roster's first page, so a page fetched before the mark can't report the conversation unseen and mark it a second time. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…very SVG Co-Authored-By: Claude Opus 5.5 <[email protected]>
guidovizoso
left a comment
There was a problem hiding this comment.
Both notes are fixed in ef6b671: every open marks the conversation read while it is in sight, and the marking asks inSight() itself, with the re-check covering a return that fires no event. The new tests cover each case and CI is green.
Two small things I noticed, neither needs a change here: each mark-read also refetches the attention query on success, so every open and run end now costs one extra read, and the one-second re-check runs for as long as a mark is owed in a background window.
|
Thanks for the approval, Guido. Both threads are resolved and CI is green, but my account can't merge into |
Unreleased gains, from the code of each change since rc.5 (OpenBot main a9ba3fe to 25d50a1, and the server since rc.5's): a Bot's work folded with a shimmer on the running step (#2201), long tasks that keep going instead of stopping as too long (#2184), a push to your phone when a Bot finishes while you're away and a conversation marked read only while it's seen (#2192), an invited address with no account signing up (#2187), the version on screen on OpenBot Cloud (#2197), Setup's model row as the reader's AI (#2185), Admin's managed-updates and favicon requests (#2186), the screen guide's Open apps and Every Bot, the pre-upgrade backup of every database with a restore command, and the API's invitationSignUp and setup checklist wording. release-policy.json: fromVersions adds v1.2.0-rc.5 and database.from adds its last migration, 0181_organization_ai_sign_in_credentials.
Unreleased gains, from the code of each change since rc.5 (OpenBot main a9ba3fe to 25d50a1, and the server since rc.5's): a Bot's work folded with a shimmer on the running step (#2201), long tasks that keep going instead of stopping as too long (#2184), a push to your phone when a Bot finishes while you're away and a conversation marked read only while it's seen (#2192), an invited address with no account signing up (#2187), the version on screen on OpenBot Cloud (#2197), Setup's model row as the reader's AI (#2185), Admin's managed-updates and favicon requests (#2186), the screen guide's Open apps and Every Bot, the pre-upgrade backup of every database with a restore command, and the API's invitationSignUp and setup checklist wording. release-policy.json: fromVersions adds v1.2.0-rc.5 and database.from adds its last migration, 0181_organization_ai_sign_in_credentials.
Conflicts: - mark-read.ts: main's version, the reviewed form of what #2188 carried early (#2192). - mobile-build.yml: mobile's version (#2203: production builds and store upload) over main's preview-only one (#2180). - app-guidelines.md: mobile's rows for OpenBot Mobile, plus main's web manifest row. - client-version cases and the mobile test: main's 9.0.0 minimums, with mobile's name OpenBot Mobile. - CHANGELOG.md: both entries. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Why
The server is about to tell a person's phone about an answer they asked for and walked away from: a reply, a failure, or a card waiting on them that is still unread 45 seconds after the run ended. "Unread" is what this app says through mark-read, and two things made it say the wrong thing:
What changes
useMarkOpenChannelReadmarks the conversation read only while OpenBot is in front of the person (inSight: page visible and window focused). It marks it once they come back.runEndedIn(channelId): the chat reports every run end in the conversation, however it ended (onRunFinishedEventandonRunErrorEvent). The open conversation is then marked read when the person can see it, whether or not the roster has a row for it.The in-sight half is the same change already on the
mobilebranch. Landing it onmainlets the server pin it.Tests
app/tests/mark-open-channel-read.test.tsxhas three new cases:All 5 tests pass.
tscand Biome are clean, and thechannel-chattests pass.🤖 Generated with Claude Code