Skip to content

Desktop: a quit after connecting to an OpenBot elsewhere is not setup abandoned - #2791

Open
ACl365 wants to merge 17 commits into
mainfrom
alex/2026-12-01/reshown-first-screen-not-abandoned
Open

ACl365 wants to merge 17 commits into
mainfrom
alex/2026-12-01/reshown-first-screen-not-abandoned

Conversation

@ACl365

@ACl365 ACl365 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

#2566's merge note left one thing to keep in mind when reading the funnel: "On a later launch where the first screen shows again (Sign in again after a sign-in ended), step_viewed connect_openbot still starts a setup session, so a quit there counts as setup_abandoned." This fixes that, and the same for the welcome every launch records.

A connection to an OpenBot that runs elsewhere never sends activated, and a completed openbot_connect ended the setup session for that launch only. So in a connected app every launch's welcome, and the first screen shown again (Sign in again, an OpenBot that can't be reached, Change from Settings), started a new session, and a quit or a crash sent setup_abandoned. On a debug build of main connected with no saved sign-in, four launches sent 4 setup_abandoned; with this change, none.

What this changes

What proves setup ended is the choice the app keeps. Connected is first written only once a connection has worked: Connect through the relay, the window's own sign-in once the browser sign-in comes back, or Move to Cloud. While it's on record:

  • Screens are counted, never abandoned. The launch's first screen and every step_viewed from the setup window are still sent, but start no setup session (record_step_after_setup, from record_setup_event).
  • Keeping a connected choice closes any open session (keep), whether or not completed was sent. That covers Move to Cloud without a recorded activation and, defensively, a Connect whose window names no screen (the window always names it today).
  • A crash's leftover session closes quietly. A launch that finds the choice closes it without setup_abandoned, in the same write that opens its usage data (open_with_setup).
  • The window's own sign-in ends setup once the browser sign-in comes back, when connect_window_now keeps the choice and Desktop's window signs in with OpenBot's own session cookie, like a browser #2768 counts its completed (only an OpenBot whose metadata names the window sign-in offers it). So on a first setup whose page then can't trade its code (window_sign_in_failed), Sign in again is not abandoned either, though the person never reached OpenBot. Main abandons it.
  • Choosing OpenBot (Self-Contained) there starts a setup at its first screen, as a first launch does (use_this_computer), and sends one step_viewed welcome at once.
  • setup_failed still names the last screen shown. Turning usage data off clears it and the duplicate rule's last view.

No event, property or value is added or renamed; the closed-schema tests pass unchanged. Beside setup_abandoned, two things sent change: that welcome, and a first view after usage data is turned back on that repeats the last one before. A setup_abandoned an earlier release recorded on quit still arrives after the update, so compare across this release by openbot_version. desktop/TELEMETRY.md says all of this (docs/TELEMETRY.md doesn't describe the setup session). Nothing changes in the window.

Every way to the first screen:

Route A quit or crash after it Test
First setup on this computer, a relaunch during it, a planned Windows restart abandoned until activated (unchanged) a_plain_quit_during_setup_still_sends_setup_abandoned, next_launch_records_abandoned_step_after_crash_before_activation, a_planned_windows_restart_sends_restart_required_and_setup_goes_on_after_it
First launch, Cloud or a company address, sign-in only started, failed or cancelled abandoned (unchanged) the first-setup cases of a_first_screen_shown_again_after_a_connection_is_not_abandoned_on_quit_or_crash and a_step_shown_again_after_setup_is_counted_and_a_quit_there_is_not_abandonment
First launch, connected through the relay or the window's own sign-in not abandoned; now also when the window names no screen a_first_launchs_connect_through_the_relay_ends_setup_so_its_quit_is_not_abandoned, a_window_sign_in_ends_setup_and_its_sign_in_again_is_not_abandoned
The window's sign-in let go, the choice still connected (window_sign_in_failed, show_window_saved, the page's Sign out) now not abandoned the same, and a_saved_window_sign_in_no_longer_published_is_not_abandoned
The window back at the first screen in the same launch (watch_window_load; OpenBot's own sign-in page signing in again) now not abandoned the record_setup_event rule; the navigation's own tests have no telemetry assertion
Later launch, connected and signed in, also the security floor's notice now not abandoned (was: at welcome) the connected cases of a_first_screen_shown_again_after_a_connection_is_not_abandoned_on_quit_or_crash; the notice sends no step_viewed of its own, so its launch is that case
Later launch, the sign-in ended: Sign in again, also started or failed now not abandoned the same test; App.test.tsx pins the window's payload
While connected: the sign-in ends while OpenBot shows (relay expiry, the web app's sign-out, sign_in_refused), the saved OpenBot can't be reached (Stop reconnecting, Try again), Sign out (any menu, or the setup window's), Settings' Change now not abandoned a_first_screen_shown_again_by_an_ended_sign_in_is_not_abandoned, a_first_screen_shown_again_by_an_unreachable_openbot_is_not_abandoned, a_first_screen_shown_again_by_a_sign_out_is_not_abandoned, a_first_screen_shown_again_by_settings_change_is_not_abandoned
The first launch of this release after an earlier version crashed while connected now closed without setup_abandoned a_connected_launch_closes_the_session_an_earlier_crash_left
OpenBot (Self-Contained) chosen there a new setup, abandoned until activated use_this_computer through its own IPC; App.test.tsx
Move to Cloud now not abandoned without activated; a move cancelled or failed before it saves is unchanged a_connection_kept_by_move_to_cloud_ends_the_setup_session, which calls keep_moved_choice as the saved move does
The window shown again without a launch (Dock, tray, a second launch, a notification while it runs) as the screen it shows not tested on its own: only a launch and use_this_computer record a launch's view
Usage data off, then back on now the first view after it counts a_step_shown_before_an_opt_out_names_nothing_after_it
An organization switch, the OpenBot for Business booker, usage data off alone, Settings' Change on this computer unchanged a_connection_kept_ends_the_open_setup_session_and_sends_nothing, a_setup_failure_after_a_screen_shown_again_names_that_screen, business_telemetry_ipc_accepts_a_place_and_nothing_else, turning_usage_data_off_writes_the_opt_out_and_prevents_telemetry_link; Settings' Change on this computer isn't tested here

A company's address goes through every Cloud row the same way; the IPC tests use one.

Known limits, each true before this change. Quit reads the open step and records setup_abandoned in two steps, so a connection completing in that moment can be followed by an abandonment. The window's own sign-in counts completed before its page trades the code (#2768's order), so a failed trade follows a completed. On Windows, a windows_stage between the welcome sent when OpenBot (Self-Contained) is chosen and the window's own can count Welcome twice, as on main. Turning usage data off and back on records the installation as activated (resume_sharing), so a connected app that then chooses OpenBot (Self-Contained) and quits before Start sends no setup_abandoned.

Where it runs

  • New state that outlives a request? None on a server. On the computer, the same telemetry-state.json and connection.json, with no new field.
  • What happens on the second replica? Nothing changes: this is OpenBot Desktop's usage data, queued on each computer.
  • Anything serialised? No.
  • Fanned out to a browser? No.
  • New listener, port, or schedule? No.

Boundary and audit

  • Nothing new acts, refuses or is trusted: this changes only which usage-data events Desktop sends.

API and database

  • This changes nothing under api/, no app's requests, no database change and no release-policy.json.

Changelog

OpenBot Desktop.

  • Usage data no longer counts a connected Desktop's quit as setup abandoned. While you share usage data, once OpenBot Desktop is connected to an OpenBot that runs elsewhere, quitting it, or a crash, no longer counts as setup abandoned. That holds at any launch, and when its first screen shows again, such as Sign in again or Change from Settings. That screen is still counted, and a first setup that quits before it connects still counts as abandoned. Nothing changes in the app (desktop/TELEMETRY.md).

Proof

Red/green, on 01670c096 (22:35 to 22:36 UTC). Each rule switched off alone, then restored. Restored, all 39 connected_ipc tests and the library test pass.

Switched off Fails
record_setup_event's rule (if false && …) 8: the connected cases of the first-screen test, the ended sign-in, the unreachable OpenBot, Sign out, Settings' Change and both window sign-in tests, each with SetupAbandoned { step: ConnectOpenbot } on quit; and the setup failure after a screen shown again, which no longer names that screen
keep's call to setup_ended 3: Move to Cloud (SetupAbandoned { step: Welcome }), and the relay and window Connects that name no screen (ConnectOpenbot)
setup_ended_with_connection, made false 9: those 8 and the earlier version's crash
end_setup_session clearing the last screen shown with no session open 2: the library test, and the setup failure after an organization switch

Across the boundaries. The window's payloads go through the real record_setup_event under the setup window's origin, with a real connection.json, and the window's own sign-in runs against the window stand-in (connected_ipc, window_ipc_tests.rs). Seven routes run with a quit and with a crash, each checked at quit and again at the next launch. App.test.tsx pins what the window sends: connect_openbot once for the unreachable OpenBot and for Settings' Change, and welcome once OpenBot (Self-Contained) is chosen.

Real build, connected with no saved sign-in. Two debug builds on this Mac, 2 December 09:58 to 10:00 UTC, each with a local usage-data sink and connected with no saved sign-in, so every launch showed the first screen: main 7f1a60daf, and this change at 2958bcfdf (later commits change only tests, comments, docs and the opt-out's locks). Over launch and Quit, relaunch and Quit, launch and a crash, relaunch and Quit, main sent 8 step_viewed and 4 setup_abandoned; this change, 8 and none. Main's Desktop commits since (the install token, Windows' approval prompt, the window's history on Windows, a sign-in test) touch none of the telemetry files, desktop_connected.rs or the window.

Local runs on 01670c096 (22:29 to 22:35 UTC), this branch with main 1c30c3f61 merged in (merge commits, no conflicts, no rebase or force-push):

  • cargo test --locked --no-fail-fast: lib 1706 passed, app 533 passed, integration 7 passed. One fails, install::tests::osascript_saying_user_canceled_is_a_closed_prompt, as it does on main on this Mac: macOS in British English says "User cancelled. (-128)".
  • bun test desktop/src: 1005 tests, 713 passed, 292 skipped, 0 failed.
  • Clean: cargo fmt --check, bun run format:check, bun run lint, bun run typecheck, desktop typecheck and typecheck:desktop-workbench, bun desktop/scripts/desktop-version.ts check and its test (30 passed), app/tests/settings-usage-data.test.tsx (4 passed), scripts/check-launcher-inputs.ts.
  • cargo clippy --locked --all-targets -- -D warnings: clean apart from main's two doc_lazy_continuation lints in local_eval_ipc_tests.rs (lines 691 and 692), which this doesn't touch.

The pushed head aa2cd1712 adds main 37216bdde (#2797, #2811, #2813, #2815, #2818, #2819, #2821), which changes .github, api, app, docs, management-agent, mobile and one new file in shared/ that nothing under desktop/ imports. Nothing under desktop/ or scripts/ and no root file changed, so the Rust, bun test desktop/src, version and launcher runs stand for it; the format, lint and type checks and app/tests/settings-usage-data.test.tsx were run again on this merge and pass. CI last ran on 9e99aafd8 (45 checks passed, 10 skipped). Since then the branch adds its own tests, docs and one comment, and main up to 37216bdde; CI on aa2cd1712: 45 checks passed, 10 skipped.

Real build with an OpenBot Cloud sign-in (2 December, 22:49 to 22:54 UTC). A debug build of 01670c096 with OpenBot Cloud on, as release builds have it, on a fresh installation of its own beside the installed app, sending to the normal ingest (its events say development, as a debug build's do). PostHog, for that installation, read at 23:01 UTC:

  • Launch 1: welcome (22:49:35), then openbot_connect on cloud: two attempts started then cancelled, then started and completed (22:51:03), through the window's own sign-in. Quit at 22:52:41: no setup_abandoned, as on main since Count a connection from Desktop's first screen, and the engine setup measured #2566.
  • Launch 2, the change: connected and signed in, OpenBot shown. welcome (22:54:11); Quit at 22:54:18: no setup_abandoned. On main a connected launch's welcome starts a session and this quit sends setup_abandoned at welcome (the first-screen test's connected launch fails that way with setup_ended_with_connection off, above).
  • Launch 3: the same, launched 22:54:22, Quit at 22:54:30. Nothing from it had reached PostHog by 23:01, not even its welcome, which I haven't explained. On the computer, its quit saved no setup_abandoned: Telemetry::shutdown saves one to the installation's telemetry-state.json before sending it, and that file was last written at 22:54:23.

Sign out was not run on a build: launches 2 and 3 were scripted, with no clicks in the window. Its route is tested through IPC (a_first_screen_shown_again_by_a_sign_out_is_not_abandoned).

SELECT timestamp, event, properties.step AS step, properties.outcome AS outcome, properties.screen AS screen
FROM events
WHERE properties.deployment_id = '<install_id>'
  AND event IN ('oss.desktop.step_viewed', 'oss.desktop.setup_abandoned', 'oss.desktop.openbot_connect')
  AND timestamp > now() - INTERVAL 1 DAY
ORDER BY timestamp

<install_id> is the installation's id, from its telemetry-state.json.

Desktop sends setup_abandoned on quit, or at the next launch after a
crash, while the installation is not activated and a setup step was
viewed since setup last ended. A connection to an OpenBot that runs
elsewhere never sends activated; a completed openbot_connect ends the
setup session instead, but only for that launch. Every launch records
the first screen viewed, and the first screen also shows again in an app
that is already connected: a sign-in that ended (Sign in again, at
launch or while OpenBot shows), a saved OpenBot that cannot be reached,
or the choice of where OpenBot runs asked for again from Settings. Each
of those started a new setup session, so quitting a connected app, even
one that opened its OpenBot and never showed setup, counted as
setup_abandoned. True before the connection was counted, and it would
show in the onboarding funnel as abandonment by people who are set up.

The app keeps the choice to be connected only once a connection has
worked (Connect from the first screen, or Move to Cloud). Keeping it now
closes any setup session still open, whether or not a completed was sent
(a Connect whose window named no screen, or Move to Cloud from an
OpenBot here whose activation was never recorded). While that choice is
on record, the launch's first screen and every step_viewed from the
setup window are recorded and sent as before, but start no setup
session: neither a quit nor a crash says setup_abandoned for them, also
after a Sign in again that only started or failed. A launch reads the
choice before it opens its usage data, and closes a setup session the
last run left open (a crash, or an earlier version's launch) without a
setup_abandoned in that same write, so nothing false is queued.

Choosing This computer there starts a setup on this computer at its
first screen, as a first launch does, before the window shows anything;
a quit or a crash before activated abandons it, as it does a first setup
left at the same screen. The window's own first view is not counted
twice. setup_failed still names the last screen shown, including one
shown after setup, and nothing from before a usage-data opt-out names it
after. Nothing changes in the window or in the event schema; choosing
This computer sends one step_viewed welcome at once, as a launch does,
even when the window then resumes past Welcome. After usage data is
turned back on in Settings, the first view counts again under the new
installation id.

Tests: the library's session rule, the same screen then starting a
setup, the last screen shown, the opt-out and the duplicate rule it
resets, a launch that knows setup ended (a full queue, an earlier quit's
real abandonment kept), and a kept connection ending the session; and
through open_then_launch (initialize's launch), record_setup_event,
use_this_computer and keep_moved_choice under the setup window's origin,
with a real connection.json and exact events as the quit or the crash
leaves them and after the next launch of an app on the same files and
the choice the last run kept, an earlier version's crash, a sign-in
ending while OpenBot shows (session_ended) and a saved OpenBot that
cannot be reached (show_connected failing), a test each, and a setup
failure after a screen shown again. App.test.tsx pins the window's
step_viewed on the unreachable screen and on the choice asked for from
Settings. Each rule fails its test when turned off, a Quit that does
nothing included. desktop/TELEMETRY.md says what ends setup, what is
still abandoned, what This computer sends, where a failure is placed,
and that setup_abandoned is compared across this change by
openbot_version; the CHANGELOG line also names This computer's welcome
and the count after an opt-out.
…n is not abandoned

Since the window can sign in at OpenBot's own origin with OpenBot's own
session cookie, there are two more ways through setup's end. Connecting
there keeps the choice to be connected (with the window's origin), which
ends setup as any kept connection does. And the window's sign-in can be
let go with the choice still connected: OpenBot's page could not trade
its code, or a saved window sign-in that OpenBot no longer publishes. The
first screen then shows Sign in again, which is counted and starts no
setup session, so neither a quit nor the next launch says
setup_abandoned.

Tests, through the shell's own commands against the window stand-in:
a first launch that connects through the window, then a code the page
could not trade, then Sign in again, then quit and the next launch; and
a launch whose saved window sign-in is no longer published. The first
fails with setup_abandoned when either the kept connection's end of
setup or record_setup_event's after-setup rule is turned off; the second
fails when the after-setup rule is turned off (its launch already knew
setup had ended). desktop/TELEMETRY.md names both ways.
… repeated screen after setup ends

The window's own sign-in keeps the connection once the browser sign-in
comes back, just before the window trades its code for its session at
that OpenBot, so setup has ended from then; a trade that fails then shows
Sign in again, which is not abandoned. And a screen said twice in a row
counts once unless setup ended between the two: ending setup forgets the
last screen, so the same screen shown again after it is counted again.
…onnection

The comments on keep and setup_ended_with_connection also name
connect_window_now, which keeps the connected choice once the window's
own sign-in came back from the browser, just before the page trades its
code. open_then_launch's comment names first_screen, which records the
launch's first screen by the same reading of the choice. The comment on
a screen shown after setup, then the same screen starting a setup, says
no current window flow puts the two side by side. desktop/TELEMETRY.md
says completed is counted when the window named the screen it was
pressed on (screen).
stop_sharing cleared the last screen shown and the duplicate rule's last
view with ? before it deleted the state file, so a lock poisoned by a
panic returned an error and left the file behind until the next launch
with sharing off. Each is now cleared only if its lock can be taken, and
the file is always deleted. Test: both locks poisoned, then the opt-out
deletes the file; it failed with Poisoned before.

The test of a screen shown after setup, then the same screen starting a
setup, now also crashes after the two views and asserts that the next
launch says that setup abandoned, so the saved write on that path is
tested: it fails when that write is skipped.
ACl365 added 12 commits December 2, 2026 14:24
CHANGELOG.md is written by the release from the notes in pull requests'
descriptions, so this change leaves it as it is on main and carries its
note under the description's Changelog heading instead.
…doned

A first launch's Connect from the first screen, through the relay, with and without the
screen named, then a quit and the next launch: no setup_abandoned either way, and completed
only when the screen is named. The window stand-in now also answers an authorization of the
app's own sign-in, sending the browser back with a code.
…agraphs

setup_failed's step is the last screen shown, which setup ending clears; a connection kept
with no setup session open, such as an organization switch, leaves it as it was
(end_setup_session returns before clearing it). The same in the comments on last_step_shown
and end_setup_session. setup_abandoned's paragraph is split into short ones with the same
facts, and a test's comment is wrapped to the file's width.
… are not abandoned

Sign out keeps the address, so the first screen it puts up is shown again: no setup_abandoned
on quit or at the next launch. The window sign-in test now runs Connect as the window asks it,
with the screen named (started and completed before the trade), and without, the defensive
case; the relay test shares the same Connect. App.test.tsx pins the welcome the window says
after OpenBot (Self-Contained) is chosen on the first screen shown again. The file's header and
one test's doc say what the tests run.
… with their event

setup_abandoned is setup ending before activation or before a connection is kept, and each
paragraph after it opens with the event it is about. setup_failed's step names
openbot_connect completed in full. use_this_computer's comment says it starts a setup, and two
comments are wrapped to 100 columns.
…pen keeps the step

Settings' Change while connected keeps the address, so the first screen it opens is shown
again: no setup_abandoned on quit or at the next launch. A connection kept with no setup
session open, such as an organization switch, leaves the last screen shown, in the library
and through set_organization_now before a setup failure. The quit and next-launch checks are
one helper, and a launch connected to any address another.
…dow's completed is counted

setup_abandoned names Connect through the relay, the window's own sign-in and Move to Cloud
in a sentence each. openbot_connect's completed, through the window's own sign-in, is
counted once the window goes to the page that trades its code, before the trade. launched's
comment says it is use_this_computer's view, as a launch views it.
An organization switch (set_organization_now) and a window sign-in let go
(forget_window_sign_in) also keep a Connected choice. Both run only once
the choice is already connected, so setup had already ended there, and
ending it again changes nothing. Comment only.
@ACl365 ACl365 changed the title Desktop connected to an OpenBot elsewhere is not setup abandoned on quit Desktop: a quit after connecting to an OpenBot elsewhere is not setup abandoned Dec 3, 2026

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