Skip to content

fix(login): tell the user when the device has no network - #299

Merged
BrandonKowalski merged 2 commits into
rommapp:mainfrom
JuanVqz:fix/network-unreachable-error
Oct 18, 2026
Merged

BrandonKowalski merged 2 commits into
rommapp:mainfrom
JuanVqz:fix/network-unreachable-error

Conversation

@JuanVqz

@JuanVqz JuanVqz commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What

Logging in with Wi-Fi off showed "Something unexpected happened! Check the logs for more info." The log had the real cause:

dial tcp 192.168.0.25:8080: connect: network is unreachable

ClassifyError knew refused connections, timeouts and DNS failures, but not ENETUNREACH, so it fell through to FailureUnknown.

Change

  • romm.ErrNetworkUnreachable for ENETUNREACH, classified as the new auth.FailureNetwork.
  • Login and startup screens show "No network connection! Please check that Wi-Fi is on and connected."
  • EHOSTUNREACH ("no route to host") now counts as a refused connection instead of an unknown error, so it gets the existing "Could not connect to host" message.
  • English and Spanish strings. The other locales fall back to English until translated.

Testing

  • New romm/errors_classify_test.go builds the dial errors net/http returns (wrapped the way romm/auth.go wraps them) and checks each maps to the right sentinel. A case in TestClassify covers FailureNetwork.
  • go test ./..., go vet ./... and go run ./tools/archcheck pass.
  • goi18n merge does not list the new keys as missing for es.
  • Found on a Miyoo Mini Plus (Onion 4.3.1-1) with Wi-Fi off. I have not run the new build on the device yet.

Connecting with Wi-Fi off fails with ENETUNREACH ("connect: network is
unreachable"). ClassifyError did not recognise it, so the login screen
showed "Something unexpected happened! Check the logs for more info."
even though nothing was wrong with the host.

Map ENETUNREACH to a new ErrNetworkUnreachable sentinel and
FailureNetwork, shown on the login and startup screens as "No network
connection! Please check that Wi-Fi is on and connected." EHOSTUNREACH
("no route to host") now counts as a refused connection instead of an
unknown error.

Adds the English and Spanish strings and tests for the dial failures.
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The PR gives login and startup a clear message when a connection fails with ENETUNREACH.

  • Login and startup explain when the device has no network.

No actionable issues were found. No runtime or device checks were performed.

Reviews (1) · Last reviewed commit: "fix(login): tell the user when the devic..." · Reviewed by Greptile

@BrandonKowalski
BrandonKowalski merged commit d85144b into rommapp:main Oct 18, 2026
4 checks passed
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.

2 participants