Skip to content

fix: [Internet Settings] connection type incorrectly displays as Bridge after saving MTU, reverts to DHCP on re-entry #759

Description

@PeterJhongLinksys

Description

After saving an MTU change on the Internet Settings page, the displayed connection type changes to Bridge. However, navigating back and re-entering the page shows the connection type as DHCP again.

Root Cause

The issue likely involves the interaction between _saveWanSettings() and the connection type detection logic:

  1. Save logic (lib/page/internet_settings/services/usp_internet_settings_service.dart:241): When typeChanged is false (only MTU was edited), addressingType is sent as null (skipped). However, a separate bridgeEnabled write may still occur or the device may return an ambiguous state after the MTU update.

  2. Type detection (lib/page/internet_settings/models/usp_wan_connection_type.dart:16): fromRawFields() determines Bridge mode when addressingType is empty AND bridgeEnabled is true:

    if (bridgeEnabled && addressingType.isEmpty) return bridge;

    If the post-save re-fetch returns an empty addressingType with bridgeEnabled = true, the type is incorrectly detected as Bridge.

  3. On re-entry, a fresh fetch retrieves the correct device state showing DHCP, exposing the inconsistency as a transient display issue.

Expected Behavior

Saving MTU should not alter the displayed connection type. The post-save state should correctly reflect the unchanged connection type.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions