new feature: warning if autoping is disabled #80
2 Participants
Notifications
Due Date
No due date set.
Depends on
#84 Add tests for XEP-0030 Service Discovery
devs/cproof
Reference: devs/cproof#80
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/autoping-warning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This feature introduces warning to the user if the server he is connecting to supports autoping, but autoping is disabled in settings. Autoping is an important feature since it allows to detect disconnections that happen during IP changes (such that can happen on VPN/TOR node changes). Due to its importance, it's preferred for all users to enable it if the server supports this feature.
Initially, the issue had higher significance since autoping feature sometimes got false negative server feature support (due to a bug, potentially related to
discofeature), however, feature for automatic disabling of autoping preference was changed to a warning instead in3738be4a.Resolves #1
6548329616to1f38ff05221f38ff0522to6086391b0e6086391b0eto75a035cd3475a035cd34to0a3b2b235f0a3b2b235fto45b81cf2deWIP: new feature: warning if autoping is disabledto new feature: warning if autoping is disabledbdff48c765to7fd0cded3dNo blockers — tentative notes only.
Minor / tolerable
_disco_autoping_warning_message()returnsintbut always returns0and the value is ignored — could probably just bevoid. Harmless either way.users_prefers_warninglooks like it should beuser_prefers_warning.Better to check
from == connection_get_domain()gate stops within-connect repeats (subdomain services), but there doesn't seem to be an "already warned this session" latch, so the warning looks like it re-fires on every reconnect. Since the feature targets frequent reconnects (IP changes on VPN/TOR), it might end up showing on each one — worth deciding whether that's intended, or whether a per-session flag would be nicer./notify(cons_notify_setting) and/autoping(cons_autoping_setting). No other pref appears to be shown in two settings dumps, and inside/notifyevery other line points to a/notifysubcommand whereas this one points to/autoping warning, so it slightly breaks that block's pattern. Might be cleaner to show it in just one place (likely/autoping, leaving the[notifications]storage group as-is). May not really matter.g_strcmp0(from, connection_get_domain())does no case-folding / IDNA normalisation. If a server ever echoesfromin a different case than the bound domain, the warning might silently not fire. Rare, but a normalised compare may be safer.Incidental (noticed during review, pre-existing — unrelated to this PR)
_disco_info_response_id_handler_onconnectreturns1on theconnection_get_features() == NULLpath but0on success. The id-handler dispatch treats non-zero as "keep", so the NULL path seems to leave this one-shot handler registered as a dead entry inid_handlersuntil disconnect — harmless (no crash, cleaned up later), but areturn 0there would be more consistent. Possibly intentional.Addressed.