fix: the private key export screen opens only once per popup session; a second open throws #460

Closed
opened 2026-10-05 10:22:12 +02:00 by clawbot · 2 comments
Collaborator

show() in src/popup/views/exportPrivkey.js finds the address line with $("export-privkey-dot").parentElement, then replaces that element's contents with renderAddressHtml(), which deletes #export-privkey-dot. The next show() in the same popup session gets null and throws TypeError: Cannot read properties of null (reading 'parentElement') before it navigates. A second "Export Private Key" click therefore does nothing until the popup is closed and reopened.

Steps: address screen, ···, Export Private Key, Back, ···, Export Private Key. Nothing happens, and the error is in the popup's console.

Found by the end-to-end cases for #253, which open the screen twice in one session. They reopen the popup before the second open to step around this.

Definition of done

  • Opening the export screen again in the same popup session shows it for the chosen address.
  • The popup reopen before the second open in the #253 case "leaving while the decrypt is in flight reveals no private key" (tests/e2e/run.js) is removed, so make test-e2e opens the screen twice in one session.
  • make check passes.

Model: opus-5-5

`show()` in `src/popup/views/exportPrivkey.js` finds the address line with `$("export-privkey-dot").parentElement`, then replaces that element's contents with `renderAddressHtml()`, which deletes `#export-privkey-dot`. The next `show()` in the same popup session gets `null` and throws `TypeError: Cannot read properties of null (reading 'parentElement')` before it navigates. A second "Export Private Key" click therefore does nothing until the popup is closed and reopened. Steps: address screen, `···`, Export Private Key, Back, `···`, Export Private Key. Nothing happens, and the error is in the popup's console. Found by the end-to-end cases for https://git.eeqj.de/sneak/AutistMask/issues/253, which open the screen twice in one session. They reopen the popup before the second open to step around this. ## Definition of done - [ ] Opening the export screen again in the same popup session shows it for the chosen address. - [ ] The popup reopen before the second open in the `#253` case "leaving while the decrypt is in flight reveals no private key" (`tests/e2e/run.js`) is removed, so `make test-e2e` opens the screen twice in one session. - [ ] `make check` passes. Model: opus-5-5
Author
Collaborator

Plan: show() finds the address line by an element its own rendering does not replace, and any other view with the same pattern gets the same fix. A jest test where reachable, and the #253 e2e case opens the screen twice in one session. #461 follows as its own unit (same files).

Model: opus-5-5

Plan: `show()` finds the address line by an element its own rendering does not replace, and any other view with the same pattern gets the same fix. A jest test where reachable, and the `#253` e2e case opens the screen twice in one session. https://git.eeqj.de/sneak/AutistMask/issues/461 follows as its own unit (same files). Model: opus-5-5
Author
Collaborator

Fix in #478: the address line now carries its own id, so show() no longer finds it through an element its rendering deletes. No other view had the pattern.

Model: opus-5-5

Fix in https://git.eeqj.de/sneak/AutistMask/pulls/478: the address line now carries its own id, so `show()` no longer finds it through an element its rendering deletes. No other view had the pattern. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#460