Skip to content

igate: add regional APRS-IS server choices (GH #593) - #594

Merged
kotfu merged 3 commits into
chrissnell:mainfrom
shubhambhar007:feature/igate-regional-server-dropdown
Sep 24, 2026
Merged

kotfu merged 3 commits into
chrissnell:mainfrom
shubhambhar007:feature/igate-regional-server-dropdown

Conversation

@shubhambhar007

@shubhambhar007 shubhambhar007 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the five official APRS Tier 2 regional servers to the iGate settings, along with a Custom option for other hostnames.

Existing custom server configurations remain supported.

Closes #593.

Testing

Screen.Recording.2026-09-19.at.11.47.01.PM.mov
  • 498 tests passed
  • Production build passed

@shubhambhar007

Copy link
Copy Markdown
Contributor Author

@kotfu kindly check,thanks!

@kotfu kotfu added the enhancement New feature or request label Sep 19, 2026
@kotfu
kotfu self-requested a review September 19, 2026 18:40
@kotfu kotfu assigned kotfu and shubhambhar007 and unassigned kotfu Sep 19, 2026

@kotfu kotfu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice first contribution, and thanks for picking this one up. The five hostnames and their region labels match aprs2.net exactly (including "Europe & Africa" and "Oceania"), existing custom configs round-trip correctly, and pulling the option list into igateServer.js with its own tests was the right instinct. Handbook updated too, which is appreciated.

One bug to fix before merge.

Selecting "Custom…" blanks the server field

If a regional server is already selected, switching the dropdown to Custom empties form.server:

saved=euro.aprs2.net  ->  dropdown=euro.aprs2.net, customServer=""
   after selecting "Custom…":  form.server=""

The load path sets customServer to an empty string whenever the saved server is a regional one:

customServer = serverSelection === CUSTOM_IGATE_SERVER ? form.server : '';

and handleServerSelection then restores that empty string when you switch to Custom.

On its own that would just be an empty input, but the rest of the path makes it lossy:

  • there's no client-side non-empty check on server (only server_filter is validated on save)
  • IGateConfigRequest.ToModel stores "" verbatim
  • IGateConfigFromModel substitutes DefaultIGateServer when it reads an empty server (pkg/webapi/dto/igate.go)

So an operator running euro.aprs2.net who selects "Custom…" and saves loses their regional choice and silently lands back on rotate.aprs2.net, the server this feature exists to steer people away from. The live iGate is also reconfigured with an empty hostname in the meantime. Before this change the field was a plain text input, so there was no way to blank it by touching a dropdown.

Falling back to the current value instead of the empty string fixes it, and is better UX anyway. Switching to Custom then hands you the selected host as a starting point to edit:

form.server = next === CUSTOM_IGATE_SERVER ? (customServer || form.server) : next;

Worth moving handleServerSelection into igateServer.js

The pure option-list logic got good tests, but the stateful transition stayed inline in Igate.svelte, outside the test boundary. If it moved into igateServer.js as something like nextServerState({ selection, server, customServer }, next), it would be testable under node --test alongside the rest, and this case would have been caught.

Open for discussion

Bringing in @pflarue for additional discussion. A fresh install defaults to rotate.aprs2.net, which now renders as Custom….
The original issue #593 suggests "five regional addresses plus Custom", so you implemented what was specified. However, since we
don't know what region a new graywolf install is closest to, rotate.aprs2.net is still probably the right default. What do you think about having it show up in the dropdown as "Anywhere in the world" or "Worldwide" or "Anywhere" or something similar. Then Custom isn't used for the default. What do y'all think?

@shubhambhar007

shubhambhar007 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor Author

@kotfu thanks for the review,fixed now!

Screen.Recording.2026-09-20.at.12.30.01.AM.mov

@shubhambhar007

shubhambhar007 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

@kotfu can we please merge this PR?

Fresh installs default to rotate.aprs2.net, which rendered as
"Custom…" and made an untouched setting look operator-modified. Add a
"Worldwide — rotate.aprs2.net" option ahead of the regional servers,
default the dropdown to it before config loads, and update the
handbook row to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kotfu
kotfu merged commit 408fabc into chrissnell:main Sep 24, 2026
7 checks passed
@kotfu

kotfu commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Merged -- thanks @shubhambhar007, nice work on this, and especially on moving the selection logic into igateServer.js with tests. I added one small commit before merging to settle the open question from the review: rotate.aprs2.net now appears as Worldwide at the top of the dropdown, so a fresh install no longer shows the default as Custom. The handbook row is updated to match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dropdown for APRS-IS Server setting with regional DNS names

2 participants