Skip to content

Client-only server update leaves the app empty for 96 s on a large database [📡#734] #1705

Closed
4 of 4 issues completed

Description

@donjor-agent

🤖 claude/anthropic claude-opus-5-5 (medium)

With a 22 GB database, a client-only server update leaves the app empty for about 96 s.
From the server Update click to threads showing takes about 110 s.

Origin: user request, 2026-10-11, to profile the backend/frontend split update flow in the QA VM.

update-run-labelled.mp4

Setup

Item Value
VM qa-desktop, 4 vCPU, 8 GiB
Backend t3code.service (userdata server)
Frontend desktop AppImage, client-only
From v0.0.46-hyprws-nightly.20261011.1006 (d3367ee34cff)
To v0.0.46-hyprws-nightly.20261011.1007 (68d9fe1e315f)
Database 22.4 GB statev2.sqlite, copy of a real install
Driving UI only

Timings

Step Real Clip
1. Download desktop update 5.5 s 2x
2. Restart & install click to confirm dialog 15.5 s (harness, see below) 5x
3. Confirm to frontend back 3.9 s 1x
4. Server Update: download and preflight 10 s 4x
5. Server down, app empty 91.5 s 10x
6. Server up to threads showing 6 s 1x
Idle spans between steps cut

A run with a 562 MB database had about 2.5 s of downtime, so step 5 grows with database size.

Cause

backupDatabaseOnce in apps/server/src/serviceLauncher.ts copies and fsyncs statev2.sqlite with its -wal and -shm files.
It runs in #startTrial after the old server stops, so the whole copy is downtime.

Evidence Value
Guest cp + sync of the DB 94.9 s
Measured downtime 91.5 s
Migrations .1006 to .1007 none
Backup after commit discarded

The backup bought nothing for this update.

Proposed fixes

Fix Change Gain
a Skip the backup when preflight reports no pending migrations ~90 s less downtime here
b Keep last known projects, threads, and route during reconnect No empty "Connect to a computer" state; no lost draft
UI One server-update state through the restart: stages, elapsed time, done state User sees progress instead of an empty app
c (option) Online SQLite snapshot before the old server stops Backup off the downtime path; writes after the snapshot are lost on rollback

Today the route is lost on reconnect: an open draft became a new thread.

Other findings

Verification

Nightly 0.0.46-hyprws-nightly.20261011.1014 (75aad8f), QA VM, 10.9 GB copy of a real DB.
Children: #1706, #1707, #1708.

Installed launcher Backup Downtime Runs
.1009 taken 41 to 76 s 4
.1013 skipped 1.5 to 2.5 s 4

Draft, route, and threads survived all 11 trials.

happy-update.mp4

Open gap

Moved to #1865: the service unit keeps its install-time launcher.
The Backup skip ships (#1711) and was verified above with launcher .1013.

Stop during the backup (2026-10-24)

A stop during a migration backup hangs until systemd kills the launcher at 90 s.
Approved plan: cancel the copy on stop and keep the update pending; name the backup in the client's restart label.
Cheaper-backup options stay out of scope; re-measure after upstream #22630.

Close conditions

  • Backup: skipped without pending migrations
  • Reconnect: projects and threads stay visible
  • Route: survives the server restart
  • Progress: visible through the restart
  • Dialog delay: explained or fixed
  • Re-run: large DB shows the gains
  • Stop: exits promptly during the backup
  • Resume: the update resumes on next start
  • Label: the client names the backup

Activity

  1. added
    uivisible surface, layout, interaction
    perfperformance and responsiveness
    on Oct 11, 2026
  2. 219 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    perfperformance and responsivenessuivisible surface, layout, interaction

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions