timescale.info
Sign inSign up

How OpenChronology was built

Every merged pull request of openchronology/timeline-app, its first week of commits and its releases; and before them the 2020 PureScript editor, from snapshots of its deleted repositories in the Wayback Machine. Written to this server through the HTTP API.

327 moments · 2020-03-09T00:15:08Z CE – 2026-11-02T20:11:21Z CE · by @athan · @athan

#107 · Sign the desktop in to several servers at once

  • timeline-app
  • pull request
  • packages

Closes #85: the desktop can be signed in to several servers at the same time. Items from the platform (timelines and plugins) get a chip naming their server whenever more than one server is connected. ## Native client (`src-tauri`) - `Server` keeps one connection per origin, up to 8. Each connection has its own credentials and its own generation counter. - Signing in, signing out, or disconnecting from one server doesn't touch the others. - A reply that comes back after its connection changed is dropped. - New commands: `desktop_servers`, `desktop_connect(origin)` (adds a server and puts it first, meaning in use) and `desktop_disconnect(origin)`. - `desktop_request`, `desktop_auth_start` and `desktop_auth_poll` now take a `server` argument. The webview can only reach servers that are connected. - The connected servers are saved to `servers.json`. If that file doesn't exist yet, the old single-server `server.json` is migrated. ## Editor - One server is **in use** at a time: - The account button shows its account. - New timelines are saved to it. - Comparisons are of its timelines. - The plugin library opens on it. - When a server timeline is open, the server in use is always that timeline's server. Opening a timeline from another server switches to that server without signing in again. Desktop links name their server: `#server/ /timeline/ `. - The **Servers (n)** dialog lists each server with its account and offers Use, Sign in, Sign out and Disconnect. Disconnecting from the server in use keeps its open timeline as an unsaved local copy. - Chips, shown when more than one server is connected: - **Dashboard:** your timelines and favorites from every server you're signed in to, and public timelines from every reachable server. Each server is searched for the same page and the results are merged. Compare checkboxes only work for the in-use server's timelines. - **Plugin library:** a "Library of" server picker, and each result marked with its server. - **Open timeline:** a chip next to the moment count. ## Tests - `test/accounts-browser.mjs` mocks a native client with one sign-in per server. It checks: - signing in to a second server keeps the first signed in; - the dashboard lists both servers' timelines with chips; - opening the second server's timeline sends its requests only to that server; - each server's plugin library; - signing out of one server leaves the other signed in; - disconnecting keeps the open timeline as a local copy. - Results: - Passes in Chromium, Firefox and WebKit. - The full Chromium browser suite passes, as do the unit tests. - `cargo test` passes in `src-tauri`, including a new test for separate sign-ins, disconnecting and the 8-server limit.

Sources

Open #107 · Sign the desktop in to several servers at once in the timeline