Repository navigation
Issue #241 solved: report rejected TCP addresses in the event log - #242
Open
PRINCEKK122 wants to merge 1 commit into
Open
PRINCEKK122 wants to merge 1 commit into
PRINCEKK122 wants to merge 1 commit into
Conversation
connect_tcp_with_validation_and_save validates before connecting, and on failure it set tcp_addr_validation_error and returned without calling tcp_connect. None of the paths that normally report a connection problem were reached, so the press left nothing in the event log. The only feedback was one line of plain text between the address box and the buttons, which is easy to miss. Log the rejection like every other connection failure, and give an empty field its own message. validate_tcp_addr returned "Invalid IP address" for an empty string, which reads as a typo when the greyed 127.0.0.1:9999 is placeholder text and nothing was typed at all. Tests cover both: an empty field and a malformed one each reach the event log and leave no TCP thread behind.
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.
Closes #241.
Problem
connect_tcp_with_validation_and_save(relay/src/update.rs:13) validates the address before connecting. On failure it settcp_addr_validation_errorand returned without callingtcp_connect, so none of the paths that normally report a connection problem were reached. PressingConnect TCPwith a bad address left nothing in the event log.The only feedback was one line of plain text from
tcp_validation_text(relay/src/view.rs:192), sitting between the address box and the buttons. The event log panel added in #183 exists so connection failures are visible; this was the one connection failure that never reached it.The empty-field case is the expensive one.
validate_tcp_addrreturnedInvalid IP address. Use format: 127.0.0.1:9999for an empty string, which reads as "you typed it wrong" when the greyed127.0.0.1:9999is placeholder text and nothing was typed at all.Change
log_eventalongside the inline hint, so it appears in Recent events like every other connection failure.No address entered. Type one, for example 127.0.0.1:9999.Deliberately narrow: this changes only how a rejection is reported. Which address forms are accepted is #240's question, and the placeholder's wording is #239's.
Testing
cargo testpasses, 10/10. Warning count unchanged frommain.Two tests added:
empty_address_is_reported_in_the_event_log— asserts the entry reachesevent_log, that the inline message is the empty-field one rather than the typo one, and that no TCP thread was spawned.malformed_address_is_reported_in_the_event_log— same for a malformed address. Uses127.0.0.1with no port rather than a host name, so the test stays valid whichever way Relay rejects host names, so a changing iMotions IP can't be entered as a name #240 goes.Found while testing #234: about half an hour went to diagnosing a relay that appeared not to connect, with an empty address field and nothing in the log to work from.