#131 Add the missing InvalidHostnames resource key (blank hostname error)#133
Merged
Conversation
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>
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.
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.InvalidHostnamesgetter exists, but Core'sResources.resxhad no matching<data name="InvalidHostnames">entry (it hasInvalidHostEntriesandInvalidIPAddress, just not this one), so the getter resolved to null.HostsEntry.ValidateHostnamesdoes: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
InvalidHostnameskey ("Invalid host names", matching the WinForm resource and PR Test coverage + GitHub Actions CI (x64 & ARM64), fix blank hostname error #132's value) toHostsFileEditor.Core/Properties/Resources.resx.IDataErrorInfomessage equal toResources.InvalidHostnames.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
InvalidHostnamesresx hunk (and matching test) can be dropped — the values are identical, so reconciliation is trivial.🤖 Generated with Claude Code