Fix modem URL reverting to default on settings page load#289
Merged
Conversation
The settings page JS checked if the current modem_url matched ANY driver's default URL, and if so, replaced it with the currently selected driver's default. This caused user-configured URLs like 192.168.100.1 (bridge mode) to be silently overwritten with the selected driver's default (e.g. 192.168.0.1 for Vodafone Station) every time the settings page loaded. Now only replaces the URL if it matches the previously selected driver's default (for driver switching) or if the field is empty. Custom URLs are never touched. Fixes #288
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 #288. The modem URL silently reverted to the driver's default every time the settings page loaded.
Root cause:
toggleUsernameField()in settings.js checked if the current URL was inKNOWN_DEFAULT_URLS(a set of ALL driver defaults across ALL modem types). Sincehttp://192.168.100.1is the default for 6 other drivers (TC4400, CH7465, CM3000, etc.), a Vodafone Station user with that bridge-mode URL would have it silently replaced withhttp://192.168.0.1(the Vodafone Station default) on every page load.Fix: Track the previous driver's default URL and only auto-fill when switching drivers (where the URL still shows the old driver's default) or when the field is empty. User-customized URLs are never touched.
Test plan