Skip to content

Keep the Tauri boot splash until the server is up, and get there faster - #1312

Open
joepio wants to merge 3 commits into
developfrom
cursor/tauri-server-loading-f03d
Open

Keep the Tauri boot splash until the server is up, and get there faster#1312
joepio wants to merge 3 commits into
developfrom
cursor/tauri-server-loading-f03d

Conversation

@joepio

@joepio joepio commented Aug 27, 2026

Copy link
Copy Markdown
Member

Related Issues

The desktop and Android apps open the webview before the embedded atomic-server binds. The HTML splash disappeared as soon as React started, the Store fetched into a dead port, and the page settled on "Could not reach the server" — for a node that was about to answer in milliseconds. On a failed start (another atomic-server holding the data directory) the splash also spun forever with no reason.

First contentful paint of the real app was then delayed further: HTTP bind waited on the Iroh n0 relay (up to 10s on a slow or offline network), React wiped the splash for IdentityReconcileGate's empty first paint, and the Tauri shell preloaded ~6MB of unused OPFS WASM.

Checklist

  • Add changelog entry linking to issue, describe API changes
  • Add or update tests if needed
  • Update docs if needed

What changed

The existing boot splash (spinning AtomicServer lockup in index.html) now stays up until the embedded node is actually accepting connections. The Store is not created until then, so the first fetch cannot race the bind.

Readiness is node_status, a new Tauri command: our store is up and the HTTP port is accepting (the embedder hook fires before bind(), so the store alone is too early). A startup error — the usual "Database already open" case — is written onto the splash instead of spinning forever.

HTTP HEAD is the fallback when invoke is missing, so e2e tests that fake __TAURI_INTERNALS__ without a real shell still resolve against the already-running test server. When IPC answers {ready:false}, we do not also download the SPA.

To get real content on screen sooner:

  • Iroh's n0 relay wait (up to 10s) no longer blocks HTTP bind. Same-LAN mDNS does not use the relay; WAN discovery still completes in the background.
  • The splash lives outside #root (#boot-splash) so React mount and IdentityReconcileGate cannot blank it. The gate fades it once children are about to paint.
  • The Tauri HTML transform drops unused WASM preloads (~6MB) and the atomicdata.dev preconnect. Fonts load asynchronously in the Tauri build.

Tests

  • waitForEmbeddedServer.test.ts: no-op in a browser, ready via node_status, HTTP HEAD fallback, skip HTTP when IPC already answered, fail-fast on startup error, retries, timeout, splash error DOM, hideBootSplash.
  • tauriHtml.test.ts: the Tauri transform strips WASM/atomicdata preloads from index.html.
  • tauri.test.ts still covers origin detection.
Test Files  3 passed (3)
Tests  19 passed (19)

cargo check -p atomic_lib --features db-redb,iroh --lib and cargo check -p atomic-server --lib succeeded. cargo check -p atomic-server-tauri could not run in this environment (no gdk-3.0). The Tauri GUI cannot be launched here; JS unit tests cover the splash/readiness path.

Notes

Pairing over Iroh is unchanged: POST /iroh-sync already polls until a node id is advertised, because HTTP being up never meant the transport was dialable.

Open in Web Open in Cursor 

The webview is ready before the embedded atomic-server binds, so the app
was fetching into a dead port and landing on "Could not reach the server".
Hold the HTML splash until node_status (or an HTTP fallback) says the
listener is accepting, and show the startup error on that splash if the
node never comes up.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
@joepio
joepio marked this pull request as ready for review August 27, 2026 06:10
HTTP binds without waiting on the Iroh n0 relay (up to 10s). The boot splash
lives outside #root so React does not blank it, unused WASM preloads are
stripped from the Tauri shell, and readiness uses cached IPC (HEAD only as
the e2e fallback).

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
@cursor cursor Bot changed the title Keep the Tauri boot splash until the embedded server is listening Keep the Tauri boot splash until the server is up, and get there faster Aug 27, 2026
The transform drops the preload tags; the HTML comment still names the
worker import path, which is not a fetch on the critical path.

Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
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.

2 participants