As a reader, I want to choose the Seed server the app talks to, so that I open my own site first and my comments and profile go where I expect.
Situation
The app starts on hyper.media. My team runs its own Seed site, or I am testing against dev.hyper.media. I know the address. I am on the Me tab.
What I do
Under "Connections", tap "Server".
Tap "hyper.media" or "dev.hyper.media", or
Type an address under "Another server" and tap "Connect", or
Tap a server under "Saved servers".
Go back and open the Read tab.
What I should see
The "Server" row on Me shows the host in use, for example "hyper.media".
The Server screen lists "hyper.media" with "The public Seed network" and "dev.hyper.media" with "For testing". The one in use has a checkmark.
Tapping a preset switches at once, with a light tap from the phone.
"Another server" has a field hinting "example.com", a "Connect" button, and the note "The server is checked before it is used."
"Connect" is disabled while the field is empty and reads "Checking…" while the server is checked.
I can type just a host. The app adds https and keeps only the site address, not the page.
When the check passes, the field empties, the server gets the checkmark, and it appears under "Saved servers" with its host and full address.
Saved servers are still there after I reopen the app, and so is my choice.
Swiping a saved server removes it. The note says "Swipe a server to remove it. Removing the one in use returns to hyper.media."
Back in Read, the home of the chosen server opens. Names, comments and profile edits use that server from now on.
When something goes wrong
A malformed address shows, in red, "Invalid URL. Enter a valid server address." I correct it and tap "Connect" again. The server in use does not change.
A site that is not a Seed site shows "This server has no registered site."
A server that does not answer shows "Failed to connect: " and the reason. I check the address or my connection and try again.
Not included
This is not the agent server, which is chosen separately. See Choose my agent server.
Reading one other site does not need a change here. See Open a Seed site by URL.
There is one server for the whole app, not one per identity.
The messages "This server has no registered site." and "Failed to connect" have no automated test. See Contract UI tests.
Trace
Story US-ID-08, status Shipped. These links are kept in step with the traceability matrix and with the "User stories" section of every page listed here.
Design
Page | Part it plays |
|---|---|
The radio list, saved servers and the Another server form | |
The Server row under Connections with the host in use | |
The site home that follows the chosen server | |
The separate agent server sheet this is not | |
Preset, custom and saved server rows with the checkmark | |
The URL field with capitals and correction off | |
Connect and its Checking… state | |
Hint in the footer, error in the same place in red | |
Lists this form with every message | |
Radio rows and swipe to remove | |
The selection haptic on picking a server | |
Checking, bad address, not a Seed site, unreachable, connected | |
Hosts as labels, full addresses as secondary text | |
Saved servers carried over from the earlier app | |
A typed server is checked before it is used | |
Radio group and radio roles on the rows |
Implementation
Page | Part it plays |
|---|---|
Orientation and the shared server state | |
MeServerScreen and the server actions | |
meCheckServer, parseServerUrl and the request deadline | |
The /hm/api/config check and what the server is then used for | |
server is persisted root state passed to every package | |
meServerDraft, meServers and meServerChecked | |
How resources re-ask when the server changes | |
Read follows the server through its sources | |
The server route | |
Network grants that allow any https server | |
The UI tests for presets, bad addresses and saved servers | |
The local server that answers /hm/api/config in tests | |
Unit tests for address parsing |
Code
File | What |
|---|---|
MeServerScreen | |
Server row on Me | |
meHost | |
server, persisted, default https://hyper.media | |
meServerDraft and meServers | |
meServerChecked then meAfterServer | |
mePickServer, meEditServer, meConnect, meAfterServer, meForgetServer | |
view wiring for the server route | |
parseServerUrl | |
meCheckServer | |
fetchJson with the transport deadline |
Tests
File | What it checks |
|---|---|
me: the chosen server persists across a relaunch | |
me: a bad server address is refused | |
me: a custom server is checked against its /hm/api/config before it is used | |
me: a connected custom server is saved, picked again, kept across a relaunch and swiped away | |
me: empty state offers create and import | |
parseServerUrl: adds https and keeps the origin; invalid; credentials and nonhierarchical schemes cannot silently select another host | |
Me server and profile reads give Exact native transport their requested deadlines |
Delivery
Delivered by #1470.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime