Skip to content

SettingsQR: accept a multiselect setting with one value - #456

Open
kkdao wants to merge 1 commit into
3rdIteration:devfrom
kkdao:fix/settingsqr-one-seed-length
Open

kkdao wants to merge 1 commit into
3rdIteration:devfrom
kkdao:fix/settingsqr-one-seed-length

Conversation

@kkdao

@kkdao kkdao commented Sep 22, 2026

Copy link
Copy Markdown

Description

Problem or Issue being addressed

Applying a SettingsQR that picks exactly one seed word length — seedlen=24, what a 24-word-only user would write — passes the review screen and then crashes on Apply to the unhandled-error screen, with navigation history cleared and the settings ahead of that key already applied.

A multiselect setting given one value arrives as a bare value (here an int), and set_value() requires a list.

Solution

In Settings.update(), where multiselect values are already cleaned, wrap a single non-list value in a list. That covers settings.json as well as SettingsQR. None still falls back to the defaults.

Additional Information

The generic test applies one value to every multiselect setting except the smartcard interfaces, which power USB ports and restart PCSC; it fails, rather than runs, if any setting tries to run a command.

Screenshots

N/A — no screen change.


This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Other

Checklist

I ran pytest locally

  • All tests passed before submitting the PR
  • I couldn't run the tests
  • N/A

Fork CI's test (3.10) and test (3.12) lanes (the full suite, screenshots included) are green on this exact code. The desktop matrix was left to this repository's CI: the change touches no platform code.

I included screenshots of any new or modified screens

  • Yes
  • No
  • N/A

I added or updated tests

  • Yes
  • No, I'm a fool
  • N/A

I tested this PR hands-on on the following platform(s):

  • Raspberry Pi OS
  • SeedSigner OS on a Pi0/Pi0W board
  • Emulator

Not hardware-tested: the change is dictionary handling after the QR is decoded; scanning is unchanged.

I have reviewed these notes:

  • I understand

A SettingsQR that picks exactly one option gives a bare value rather
than a list -- "seedlen=24" parses as an int. It passes parsing and the
review screen, and then set_value() refuses it, so Apply ends on the
unhandled-error screen with the keys ahead of it in the dict already
applied and the navigation history cleared.

Wrap a lone value in a list where the other multiselect shapes are
cleaned, which covers the settings.json path as well. seed_word_lengths
is the only int-valued multiselect today, but nothing about this was
specific to it.

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