Skip to content

#131 Add the missing InvalidHostnames resource key (blank hostname error)#133

Merged
scottlerch merged 1 commit into
masterfrom
fix/131-invalid-hostnames-resx
Jul 14, 2026
Merged

#131 Add the missing InvalidHostnames resource key (blank hostname error)#133
scottlerch merged 1 commit into
masterfrom
fix/131-invalid-hostnames-resx

Conversation

@scottlerch

Copy link
Copy Markdown
Owner

User-facing bug fix, split out of the larger CI/coverage PR #132 so it can land on its own (per your request). No release needed on its own, but this is a real visible bug in shipped v1.5.1/v1.2.1.

Problem (issue #131)

The strongly-typed Resources.InvalidHostnames getter exists, but Core's Resources.resx had no matching <data name="InvalidHostnames"> entry (it has InvalidHostEntries and InvalidIPAddress, just not this one), so the getter resolved to null. HostsEntry.ValidateHostnames does:

SetError(nameof(HostNames), !_hostnamesValid ? Resources.InvalidHostnames : null);

and SetError(null) clears the error — so an invalid hostname surfaced a blank validation message in both the classic (WinForms) and modern (WinUI) editions, instead of "Invalid host names".

Fix

Full Core suite green (193).

Relationship to PR #132

This is the same one-line resx fix (+ an equivalent regression test) that's bundled inside the larger CI + test-coverage PR #132. Landing it here lets the visible bug ship independently; when #132 is later reviewed/rebased, its now-redundant InvalidHostnames resx hunk (and matching test) can be dropped — the values are identical, so reconciliation is trivial.

🤖 Generated with Claude Code

The strongly-typed Resources.InvalidHostnames getter existed but Core's
Resources.resx had no matching <data name="InvalidHostnames"> entry, so it
resolved to null. HostsEntry.ValidateHostnames does
`SetError(nameof(HostNames), !_hostnamesValid ? Resources.InvalidHostnames : null)`
and SetError treats null as "clear the error", so an invalid hostname surfaced a
BLANK IDataErrorInfo message in both the classic and modern editions instead of
"Invalid host names".

Add the key ("Invalid host names", matching the WinForm resource) plus a
regression test asserting the invalid-hostname error message is the non-empty
resource string. Split out of the larger CI/coverage PR #132 so the user-facing
fix can land on its own.

Closes #131

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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