Skip to content

fix(desktop): stop the provider wizard crashing when left mid-step - #1179

Draft
sosidudku1 wants to merge 1 commit into
rel/xp-buildfrom
fix/ato-1281-wizard-missing-row
Draft

sosidudku1 wants to merge 1 commit into
rel/xp-buildfrom
fix/ato-1281-wizard-missing-row

Conversation

@sosidudku1

Copy link
Copy Markdown
Collaborator

Careful tier: touches logic outside the UI, please review closely.

What

  • wizardHTML draws the provider list when the wizard has a phase but no provider row, instead of throwing.
  • New helper wizStepLeft(k): after each await in wizNextStep and wizSubscriptionStep, a step that resumes after the wizard was closed or reopened on another row stops there. It drops its own unfinished entry, the same cleanup leaving the wizard already does, and no longer pops the closed wizard back up.
  • New test desktop/test/wizard-left-mid-step.test.mjs in the existing vm harness style.

Why

Desktop 0.0.7 crash report: TypeError in wizardHTML (k.custom with k = WIZ.row empty), reached from wizNext → wizNextStep → render. Cancel only clears the phase, and Add a provider resets the row. A step still waiting on a key check or the model list then set a new phase and redrew a wizard with no row, which took down the whole window.

How it was verified

Not yet checked on the second Mac: this draft waits for one combined build, test, smoke and e2e run together with the other open fixes.

Static checks so far:

  • The new test fails on the old code (the old wizardHTML throws with no row; with the guards removed the stale step moves the reopened wizard to the model step).
  • Read-only review of every await before a phase change, the rollback order, wizRemoveIfIncomplete (only drops entries this step created without a model) and the exact branch from the crash report.
  • Scope guard and attribution check: clean.

Left as before: cancelling and reopening on the same provider row while the old step is still pending lets that step continue (no crash, since the row is set); wizActivate after swxRun has no stale-step check.

A wizard step awaiting the network could outlive its wizard. After
Cancel and Add provider again (row cleared, phase pick_kind), the step
resumed, set pick_model and redrew with no row, and wizardHTML threw
reading row.custom.

wizardHTML now draws the provider list when there is no row, and the
wizard steps stop after each await once their wizard was left or
reopened on another row, dropping the entry they left without a model.

Refs ATO-1281

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant