Run the status API server from apps/fluxer according to LocalSettings.status_api #58

Closed
opened 2026-11-11 11:53:33 +00:00 by charles · 1 comment
Owner

Found while building Task 22 (settings skeleton), on task/22-ui-settings-parity.

Settings → Desktop app → Companion apps now toggles LocalSettings.status_api.enabled and regenerates LocalSettings.status_api.token (both saved to settings.toml), but nothing in apps/fluxer starts fluxer-status-api: the runtime never reads status_api, so 127.0.0.1:21863 does not answer whatever the switch says. apps/fluxer/README.md says "fluxer-status-api joins with Task 22", but Task 22's file list in the plan is xtask, docs/parity, fluxer-ui and fluxer-core/src/settings_tabs.rs; no Foundation task has the wiring in its files.

What is needed (in apps/fluxer):

  • start the server after PersistResult::Loaded when status_api.enabled, with status_api.token;
  • on each PersistOp::SaveSettings, compare status_api with what the server runs with: stop it when disabled, start it when enabled, restart (or swap the token) when the token changed, so "Regenerate" really disconnects the apps using the old token;
  • not in --devserver mode unless asked, so a dev run does not take the port from the real client;
  • port already in use: log it and say so in the panel (the Electron panel shows "The status API can't start because another program is using port 21863."), which needs a way to report it to the store.

Foundation acceptance criterion 9 ("Status API answers on 127.0.0.1:21863 with the Foundation payload; Companion apps settings work") depends on this.

Found while building Task 22 (settings skeleton), on `task/22-ui-settings-parity`. Settings → Desktop app → Companion apps now toggles `LocalSettings.status_api.enabled` and regenerates `LocalSettings.status_api.token` (both saved to `settings.toml`), but nothing in `apps/fluxer` starts `fluxer-status-api`: the runtime never reads `status_api`, so 127.0.0.1:21863 does not answer whatever the switch says. `apps/fluxer/README.md` says "`fluxer-status-api` joins with Task 22", but Task 22's file list in the plan is `xtask`, `docs/parity`, `fluxer-ui` and `fluxer-core/src/settings_tabs.rs`; no Foundation task has the wiring in its files. What is needed (in `apps/fluxer`): - start the server after `PersistResult::Loaded` when `status_api.enabled`, with `status_api.token`; - on each `PersistOp::SaveSettings`, compare `status_api` with what the server runs with: stop it when disabled, start it when enabled, restart (or swap the token) when the token changed, so "Regenerate" really disconnects the apps using the old token; - not in `--devserver` mode unless asked, so a dev run does not take the port from the real client; - port already in use: log it and say so in the panel (the Electron panel shows "The status API can't start because another program is using port 21863."), which needs a way to report it to the store. Foundation acceptance criterion 9 ("Status API answers on 127.0.0.1:21863 with the Foundation payload; Companion apps settings work") depends on this.
charles added this to the Foundation milestone 2026-11-11 11:53:33 +00:00
Author
Owner

Done on textchat (c24495a): apps/fluxer/src/runtime.rs:60,176,388,845: starts fluxer-status-api and reconciles it with settings.status_api

Closed during the 2026-11-14 issue triage.

🤖 Generated with Claude Code

Done on `textchat` (c24495a): `apps/fluxer/src/runtime.rs:60,176,388,845`: starts `fluxer-status-api` and reconciles it with `settings.status_api` Closed during the 2026-11-14 issue triage. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#58
No description provided.