#8641·omnigent

[Bug] Import sessions says "Imported 0." after importing the sessions it just listed

Author: vb-dbrksCreated Sep 30, 2026Updated Oct 1, 2026
LabelsBughelp wantedcomp:servercomp:web-uiP2-mediumtriagedvalidated:likely_repro

Description

When I import recent sessions from Settings > Import sessions, the panel fills in a list of session titles as the import runs, and the sessions really are imported ... they show up in my sidebar. But once it finishes the summary line says "Imported 0." instead of the real total.

I think this is the client falling back to its starting value when the stream's closing done line never arrives. In importLocalSessions (web/src/lib/sessionsApi.ts), imported starts at 0 and is only set from the done event. The list comes from the per-session session events, so if the body closes before done you get a full list with "Imported 0." above it, which is what I saw.

The server side looks right to me: _import_local_core bumps counts["imported"] once per session it yields, so a done that actually arrived would have said the right number. So the question is why done went missing. My guess is something in front of the server closing a long response early (it happened on "Last 100"), but I can't see server logs so I can't confirm that. If it's an exception after the import loop instead, that would be worth a look too.

Either way the client shouldn't report 0 next to sessions it just listed. I have a small fix ready: if the stream ends without done, treat it like a mid-stream error and say how many sessions were imported, e.g. "The import stopped before it finished. 38 sessions were imported. Import again to pick up the rest." Re-running is safe since already-imported sessions are skipped. Sending it as a PR now.

Steps to reproduce

  1. Open Settings > Import sessions in the desktop app
  2. Pick your machine, "Recent sessions", "All harnesses", "Last 100"
  3. Click Import
  4. The list fills in with session titles while it runs
  5. When it finishes, the summary says "Imported 0." with no already-imported or failed counts
  6. The listed sessions are in the sidebar, so they were imported
Image

Version

Desktop app 0.14.0, host 0.16.0.dev2

OS

macOS 26.6.2

Harness

Not applicable

Platform or device

Desktop app

Observed impact

Some users or sessions

Authentication type

Not authentication-related