fix: remove hardcoded desktop gateway URL default and allow clearing optional fields - #86
Open
realchrisolin wants to merge 1 commit into
Open
realchrisolin wants to merge 1 commit into
realchrisolin wants to merge 1 commit into
Conversation
…optional fields - _AddDialog: the 'Desktop Gateway URL' field defaulted to a hardcoded developer IP (http://192.168.1.193/desktop) instead of empty. - _validateAndSave: empty optional fields (gateway prefix, dashboard prefix, desktop gateway URL) were converted to null before save, but updateConnection's clear* flags require a non-null empty string to detect a clear — so these fields could never be cleared on an existing connection. Pass the raw (possibly empty) value through instead.
rusty4444
approved these changes
Aug 20, 2026
rusty4444
left a comment
Owner
There was a problem hiding this comment.
Code Review: PR #86 — hermes-android
Verdict: ✅ Approve (no blocking issues)
Reviewed by Hermes Agent (daily automation).
Summary
Two fixes in lib/main.dart _AddDialogState:
- Removes the hardcoded dev IP default
http://192.168.1.193/desktopfor the Desktop Gateway URL field — correct, this was a leak of a developer machine address. - Passes raw (possibly empty)
gatewayPrefix/dashboardPrefix/desktopGatewayUrlvalues through instead of converting empty→null.
Verification
I verified the second change against the updateConnection contract in lib/core/services/connection_manager.dart (lines ~265–287):
clearGatewayPrefix: gateway != null && gateway.isEmptyclearDashboardPrefix: dashboard != null && dashboard.isEmptyclearDesktopGatewayUrl: desktopGateway != null && desktopGateway.isEmpty
Empty→null conversion made clear* flags impossible to trigger on existing connections, so these fields could never be cleared. Passing the raw value through is the correct fix.
Notes
⚠️ No CI checks reported on this PR branch (fork PR, cross-repository). Not eligible for auto-merge until CI runs and passes.dashboardUsername/dashboardPasswordstill convert empty→null at call sites;updateConnectionderivesclearDashboardUsername/clearDashboardPasswordfrom non-null empty values — the same latent bug may exist there. Non-blocking suggestion for a follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two bugs in the connection add/edit dialog that made the Desktop
Gateway URL field effectively unmanageable. This matters because, per #84,
stock Hermes always falls back to legacy REST — reaching a clean REST setup
is the only practical path, and these bugs block it.
1. Hardcoded default
_AddDialogdefaulted "Desktop Gateway URL" to a hardcoded developer IP(
http://192.168.1.193/desktop) instead of empty, so a fresh connectionpre-filled a bogus URL.
2. Un-clearable fields
_validateAndSaveconverted empty optional fields (gatewayPrefix,dashboardPrefix,desktopGatewayUrl) tonullbefore saving, butupdateConnection'sclear*flags (inconnection_manager.dart) require anon-null empty string to detect a clear. With
nullpassed,copyWith'snull ?? oldValuekept the previous value, so these fields silently revertedto their last value on every edit.
Changes
lib/main.dartonly — pass the raw (possibly empty) value through instead ofnull-coalescing it, and default the desktop gateway field text to empty.
Verification
Built and installed locally; confirmed the "Desktop Gateway URL" field now
defaults to empty and can be cleared on an existing connection, allowing the
app to fall back to REST chat against a stock Hermes gateway.
Related
fix makes the documented REST fallback reachable without a working Desktop
Gateway.