SDL's "Welcome Back" screen's Cancel button not functioning correctly #81

Closed
opened 2 years ago by jahway603 · 5 comments
Collaborator

SDL Versions affected:

Tested on...
OS: Arch Linux
Kernel: 5.16.10-arch1-1 #1 SMP PREEMPT Wed, 16 Feb 2022 19:35:18 +0000 x86_64 GNU/Linux
Rust version: rustc 1.56.0 (09c42c458 2021-10-18)
QT Version: 5.15.2+kde+r301-1

Issue Description
When I start up either of the affected SDL versions, I can enter my wallet's encryption password and then access my wallet as is expected. The issue happens when instead I hit the "Cancel" button on that "Welcome Back" screen instead of inputting that passwd.

  • If I run v 1.5.2, it crashes with "Segmentation fault (core dumped)"
  • If I run v 1.5.3, it instead brings me to the "New Wallet Wizard"

Expected behavior

  1. Start up SDL (either version) with a currently existing wallet on the system.
  2. Have the "Welcome Back" screen appear to the user.
  3. The user then last minute decides to not open their wallet and they instead hit the "Cancel" button.
  4. SDL should close and not open the "New Wallet Wizard".
**SDL Versions affected:** - 1.5.2 release - 1.5.3-dev branch (https://git.hush.is/hush/SilentDragonLite/commit/e420c93aa6e99454388fb540364be91525fd70cf) **Tested on...** OS: Arch Linux Kernel: 5.16.10-arch1-1 #1 SMP PREEMPT Wed, 16 Feb 2022 19:35:18 +0000 x86_64 GNU/Linux Rust version: rustc 1.56.0 (09c42c458 2021-10-18) QT Version: 5.15.2+kde+r301-1 **Issue Description** When I start up either of the affected SDL versions, I can enter my wallet's encryption password and then access my wallet as is expected. The issue happens when instead I hit the "Cancel" button on that "Welcome Back" screen instead of inputting that passwd. * If I run v 1.5.2, it crashes with "Segmentation fault (core dumped)" * If I run v 1.5.3, it instead brings me to the "New Wallet Wizard" Expected behavior 1. Start up SDL (either version) with a currently existing wallet on the system. 1. Have the "Welcome Back" screen appear to the user. 1. The user then last minute decides to not open their wallet and they instead hit the "Cancel" button. 1. SDL should close and not open the "New Wallet Wizard".
Poster
Collaborator

Unsure if this is related or not, but after drafting up this bug, I started up 1.5.3 for more testing and all of the Hushchats I had were gone. I then closed that and opened 1.5.2 with the same result. This may or may not be related to what is happening when 1.5.3 goes to the "New Wallet Wizard" after hitting Cancel.

I see this somewhere on the CLI

renderChatBox : looking at memos...
No Hush contacts found on disk!
Unsure if this is related or not, but after drafting up this bug, I started up 1.5.3 for more testing and all of the Hushchats I had were gone. I then closed that and opened 1.5.2 with the same result. This may or may not be related to what is happening when 1.5.3 goes to the "New Wallet Wizard" after hitting Cancel. I see this somewhere on the CLI ``` renderChatBox : looking at memos... No Hush contacts found on disk! ```
Collaborator

I think this is fixed in: 7398c70e2b

There is some potentially unnecessary code for this that may need to be removed entirely and may be related to #51
I was not experiencing a coredump in testing though.

The cancel button first calls this:
https://git.hush.is/hush/SilentDragonLite/src/branch/dev/src/mainwindow.cpp#L377

And then this:
https://git.hush.is/hush/SilentDragonLite/src/branch/dev/src/mainwindow.cpp#L436

Might be other weirdness if choosing to create or restore wallet here that I need to test.

I think this is fixed in: https://git.hush.is/hush/SilentDragonLite/commit/7398c70e2b9f592310e8727f5c9542ccbcb933a9 There is some potentially unnecessary code for this that may need to be removed entirely and may be related to https://git.hush.is/hush/SilentDragonLite/issues/51 I was not experiencing a coredump in testing though. The cancel button first calls this: https://git.hush.is/hush/SilentDragonLite/src/branch/dev/src/mainwindow.cpp#L377 And then this: https://git.hush.is/hush/SilentDragonLite/src/branch/dev/src/mainwindow.cpp#L436 Might be other weirdness if choosing to create or restore wallet here that I need to test.
Collaborator

I reverted and will need to look into further. closeEventpw ends up getting called elsewhere if you choose to create a new wallet or restore from seed on welcome back screen. I submit seed and then closeEventpw gets called, so can't call close there.

I reverted and will need to look into further. `closeEventpw` ends up getting called elsewhere if you choose to create a new wallet or restore from seed on welcome back screen. I submit seed and then closeEventpw gets called, so can't call close there.
Collaborator

Seems the proper way to fix this is to use slots/signals with a queued connection. I added in latest commit and seems to work. No crash on new wallet/restore from welcome back, but I did have two loading screens appear while syncing for some reason and have seen that ocassionally on SD too.

#51 coredumping may have been related to the main close event trying to shutdown rpc and rpc not existing. I added a check that maybe fixes coredump.
https://git.hush.is/hush/SilentDragonLite/src/branch/dev/src/mainwindow.cpp#L392

My initial commit of just trying to close the app was actually coredumping because of that line prior to adding check, but I thought it was closing properly. When I added a check for rpc, the app still ran when calling close. Documentation had this relevant bit on quitting and exiting:

a signal connected (non-queued) to this slot is emitted before control enters the main event loop (such as before "int main" calls exec()), the slot has no effect and the application never exits. Using a queued connection ensures that the slot will not be invoked until after control enters the main event loop.
https://doc.qt.io/qt-5/qcoreapplication.html#quit

Seems the proper way to fix this is to use slots/signals with a queued connection. I added in latest commit and seems to work. No crash on new wallet/restore from welcome back, but I did have two loading screens appear while syncing for some reason and have seen that ocassionally on SD too. #51 coredumping may have been related to the main close event trying to shutdown rpc and rpc not existing. I added a check that maybe fixes coredump. https://git.hush.is/hush/SilentDragonLite/src/branch/dev/src/mainwindow.cpp#L392 My initial commit of just trying to close the app was actually coredumping because of that line prior to adding check, but I thought it was closing properly. When I added a check for rpc, the app still ran when calling close. Documentation had this relevant bit on quitting and exiting: > a signal connected (non-queued) to this slot is emitted before control enters the main event loop (such as before "int main" calls exec()), the slot has no effect and the application never exits. Using a queued connection ensures that the slot will not be invoked until after control enters the main event loop. https://doc.qt.io/qt-5/qcoreapplication.html#quit
duke commented 1 year ago
Owner

Calling this done, re-open if it's not

Calling this done, re-open if it's not
duke closed this issue 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.