Skip to content

fix: PnP saveChanges timing incorrect for AutoParent scenario #1006

Description

@AustinChangLinksys

Summary

The PnP flow's buildSteps logic had incorrect saveChanges timing for the AutoParent scenario, and the flow control logic didn't properly handle AutoParent after saving.

Problem

In commit 436483bc (Release 1.2.12), when adding AutoParent support:

1. buildSteps saveChanges bug

// Bug: `? null : null` always returns null, WiFi steps never trigger saving
PersonalWiFiStep(saveChanges: !isGuestWiFiSupport && !isNightModeSupport ? null : null),
GuestWiFiStep(saveChanges: !isNightModeSupport ? null : null),
NightModeStep(saveChanges: null),
YourNetworkStep(saveChanges: _saveChanges),  // All saving delayed to here

2. Flow control used isUnconfigured instead of showYourNetwork

  • _saveChanges whenComplete: AutoParent (isUnconfigured=false) skipped YourNetwork
  • _showNeedReconnect: Same issue after WiFi reconnection
  • onLastStep: Triggered duplicate saving for AutoParent

Fix

buildSteps

Align AutoParent with Unconfigured - save at last WiFi step before YourNetwork:

PersonalWiFiStep(saveChanges: !isGuestWiFiSupport && !isNightModeSupport ? _saveChanges : null),
GuestWiFiStep(saveChanges: !isNightModeSupport ? _saveChanges : null),
NightModeStep(saveChanges: _saveChanges),
YourNetworkStep(saveChanges: _confirmAddedNodes),

Flow control

Replace isUnconfigured with showYourNetwork (isUnconfigured || !isPrePaired) in:

  • _saveChanges whenComplete
  • _showNeedReconnect reconnect handler
  • onLastStep condition

UI improvement

Wrap Auto Master connection error view with AppCard and maxWidth constraint for better readability.

Related

Metadata

Metadata

Labels

1.xLabeled for 1.x versionconfidence:mediumEvidence present but cross-layer or needs firmware confirmationtriagedAutomated diagnosis complete; root cause investigated (bug lane entry)

Type

Fields

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions