Skip to content

setup: point Format Disk and the failed-exchange cleanup at the Blox in use - #7

Merged
ehsan6sha merged 1 commit into
mainfrom
fix/lan-setup-base-url
Aug 28, 2026
Merged

ehsan6sha merged 1 commit into
mainfrom
fix/lan-setup-base-url

Conversation

@ehsan6sha

Copy link
Copy Markdown
Member

A gap the new LAN step opened up, found in review of #4.

SetBloxAuthorizer chooses an ip-scoped variant for the exchange (exchangeConfigAtIp) and the properties read (getBloxPropertiesAtIp), but two calls had no twin and always went to the hotspot:

bloxFormatDisk       → 10.42.0.1:3500/partition
bloxDeleteFulaConfig → 10.42.0.1:3500/delete-fula-config

Reaching this screen with an ?ip used to be possible only from ConnectToExistingBlox — re-pairing a box that is usually formatted already, so the gap stayed hidden. The LAN step added in #4 sends first-time setups here, and a first-time box is precisely the one with an unformatted disk. So:

  • Format Disk was a dead button for the users the LAN step was built for: it appears exactly when bloxFreeSpace.size === 0, then posts to an address that is unreachable from a home network.
  • The cleanup after a failed exchange silently did not run, leaving the box half-claimed with no sign to the user.

Both functions now take a base URL, defaulting to API_URL so the hotspot and BLE paths are untouched. The WAP setup listener serves the same mux on the LAN address (functionland/go-fula#248), so /partition and /delete-fula-config are there.

Coverage

New test drives the LAN path into both: a failed exchange must call bloxDeleteFulaConfig('http://10.0.0.2:3500'), and Format Disk must call bloxFormatDisk('http://10.0.0.2:3500'). The existing hotspot tests now assert the argument is API_URL rather than just "was called", and the LAN flow test asserts neither fires on the happy path. 810/810, tsc --noEmit and eslint green.

Known, not fixed here

goBack reads isLanSetup ? connectExisting : connectBlox. isLanSetup now also means "came from ConnectToBlox's LAN step", so a direct load or reload of /setup/set-authorizer?ip=… sends Back to the existing-Blox screen. History-back covers every normal case; both destinations are working setup screens.


🤖 Generated with Claude Code

https://claude.ai/code/session_01YJyqpFReP1wbz86nsqsoXq

…in use

SetBloxAuthorizer picks an ip-scoped variant for the exchange and the properties
read, but two calls had no twin and always went to the hotspot:

  bloxFormatDisk       -> 10.42.0.1:3500/partition
  bloxDeleteFulaConfig -> 10.42.0.1:3500/delete-fula-config

Reaching this screen with an ?ip was previously only possible from
ConnectToExistingBlox, where a re-paired box is usually formatted already. The
new LAN step in ConnectToBlox sends first-time setups here, and a first-time box
is exactly the one with an unformatted disk -- so Format Disk was a button that
did nothing for the users the step was built for, and the cleanup after a failed
exchange silently did not run, leaving the box half-claimed.

Both take a base URL now, defaulting to the hotspot. The WAP setup listener
serves the same mux on the LAN address, so the routes are there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJyqpFReP1wbz86nsqsoXq
@ehsan6sha
ehsan6sha merged commit 430232e into main Aug 28, 2026
2 checks passed
@ehsan6sha
ehsan6sha deleted the fix/lan-setup-base-url branch August 28, 2026 21:48
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.

1 participant