bugfix: empty notes in hobbled mode

This commit is contained in:
scgbckbone 2025-12-21 22:24:08 +01:00 committed by doc-hex
parent 8cdc09d0af
commit e449ef32ff
4 changed files with 19 additions and 3 deletions

View File

@ -22,6 +22,6 @@ This lists the new changes that have not yet been published in a normal release.
## 1.3.6Q - 2025-12-xx
- tbd
- Bugfix: Empty notes in hobbled mode caused yikes upon menu entry

View File

@ -27,7 +27,6 @@ async def make_notes_menu(*a):
# Read only version of menu system
# - used when spending policy in effect
# - must have some notes already, or unreachable
assert NoteContent.count()
rv = NotesMenu(NotesMenu.construct_readonly())
rv.readonly = True
return rv
@ -156,6 +155,9 @@ class NotesMenu(MenuSystem):
rv.append(MenuItem('%d: %s' % (note.idx+1, note.title),
menu=note.make_menu, arg=True)) # readonly=True
if not rv:
rv.append(MenuItem('(none saved yet)'))
return rv
@classmethod

View File

@ -2729,7 +2729,7 @@ from test_msg import verify_msg_sign_story, sign_msg_from_text, msg_sign_export,
from test_multisig import import_ms_wallet, make_multisig, fake_ms_txn
from test_miniscript import offer_minsc_import, get_cc_key, bitcoin_core_signer, import_miniscript, usb_miniscript_get, usb_miniscript_addr, create_core_wallet
from test_multisig import make_ms_address, make_myself_wallet
from test_notes import need_some_notes, need_some_passwords
from test_notes import need_some_notes, need_some_passwords, goto_notes
from test_nfc import try_sign_nfc, ndef_parse_txn_psbt
from test_se2 import goto_trick_menu, clear_all_tricks, new_trick_pin, se2_gate, new_pin_confirmed
from test_seed_xor import restore_seed_xor

View File

@ -481,5 +481,19 @@ def test_h_seedxor(set_hobble, need_keypress, press_cancel, cap_screen,
press_cancel()
def test_empty_notes_bug(set_hobble, goto_notes, cap_menu, pick_menu_item, is_q1):
if not is_q1:
raise pytest.skip("No notes on Mk4")
goto_notes() # enable notes - but do not add any
set_hobble(True, {"notes"})
pick_menu_item("Secure Notes & Passwords")
# here yikes would follow
time.sleep(.1)
m = cap_menu()
assert len(m) == 1
assert m[0] == "(none saved yet)"
# EOF