Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Preparing to export" does not consistently transition to "Ready to export" #990

Closed
eloquence opened this issue Mar 24, 2020 · 7 comments · Fixed by #1777
Closed

"Preparing to export" does not consistently transition to "Ready to export" #990

eloquence opened this issue Mar 24, 2020 · 7 comments · Fixed by #1777
Labels
bug Something isn't working

Comments

@eloquence
Copy link
Member

eloquence commented Mar 24, 2020

STR in Qubes on master:

  1. Start the client (offline mode is fine) with sd-devices running and previously downloaded files available for export.
  2. Plug in a USB drive.
  3. Click "Export" for a downloaded file. You should see the expected behavior, with "Preparing" transitioning to "Ready".
  4. Cancel.
  5. Shut down sd-devices but do not remove USB drive. Wait for the shutdown sequence to complete.
  6. Click "Export" again.

Expected behavior

"Preparing to export" transitions to "Ready to export" once VM is back up and running

Actual behavior

Header stays "Preparing to export" while spinner/button state change.

Note

This appears to be related to the USB attach state. If you shut down and restart sd-devices, the USB drive is no longer attached to it, and subsequent exports will fail until you manually re-attach the drive to sd-devices through the Devices Widget. What's odd is that only the "Preparing to export" header behaves differently from the rest of the UI.

@eloquence eloquence added the bug Something isn't working label Mar 24, 2020
@redshiftzero redshiftzero added this to the 0.2.xbeta milestone Mar 25, 2020
@ninavizz
Copy link
Member

ninavizz commented Mar 26, 2020

I did an Export shortly after rebooting my machine from the most recent nightly, so the sd-devices was not yet running—and I experienced the same. Drive was not yet inserted. I later clicked on "Print" for kicks, and observed the same.

@emkll
Copy link
Contributor

emkll commented May 13, 2020

@eloquence I've attempted to reproduce the issue described here, but it seems to be like I am observing the expected behavior. I've detailed the testing steps below, following your STR, please let me know if I missed something:

In Qubes (using make dev for system configuration), with client nightly version 0.1.6-dev-20200511-060205, tested in both online and offline mode:

  • started the client (logged in, if necessary)
  • plug in usb, click export on a file, observed "preparing for export" and "ready for export", the clicked on cancel
  • in dom0 terminal, qvm-shutdown sd-devices and waited for vm to shut down
  • In the client, clicked on export again
  1. As the machine was booting, observed the behavior described here (the client is waiting for devices to boot up):
    0-preparing-export

  2. Once sd-devices was powered on, the state transitions to ready to export:
    1-ready-to-export

  3. Clicking on continue prompts the insert USB screen
    2-insert-usb

As mentioned by @eloquence previously, the device doesn't re-attach when the VM reboots, the user needs to unplug/replug the device here. Perhaps the message could be more clear here?

  1. After unplugging/replugging the USB drive and clicking continue, the password prompt appears:
    3-enter-passphrase

  2. After entering the LUKS pasword, the file is exported successfully
    4-export-successful

@eloquence
Copy link
Member Author

@emkll You are in fact observing the bug described in this issue, but it's a very subtle one. :) Note how in your second screenshot, the headline still says "Preparing to export:". However, the header should have transitioned to "Ready for export" (defined in https://github.com/freedomofpress/securedrop-client/blob/master/securedrop_client/gui/widgets.py#L2909) by this point.

Note that this bug is relatively minor and the user may not even notice it - we pulled it in as a "polish" issue. #1088 is much more severe and could lead to significant confusion about export state, if we can reproduce it (but it's not technically on this sprint yet -- I'm inclined to keep it that way and nominate it for the next sprint).

@eloquence
Copy link
Member Author

(@rmol has committed to writing up initial findings here, which may also be relevant to #1088, but we're not planning to do additional work on either issue during the 5/20-6/3 sprint.)

@rmol
Copy link
Contributor

rmol commented May 20, 2020

What I've found in a short exploration is that we could install a Qubes admin extension that would notice sd-devices starting up and trigger the udev rules in sys-usb. This works -- the usual candidate devices will be attached -- but it's a bit of a blunt instrument, and we'll need to do some more work to ensure that existing attachments aren't moved to sd-devices, disrupting the owner's non-SDW workflow.

I believe @eloquence suggested that it might be simpler and less intrusive in this situation to detect that there are no usable export devices and prompt the owner to (re)attach one, and I'm inclined to agree.

@eloquence
Copy link
Member Author

Note the report in #1018 as well, with slightly different steps to reproduce.

@rocodes
Copy link
Contributor

rocodes commented Feb 21, 2024

This will be fixed in #1777:

  • "Preparing to export" is shown when sd-devices is starting and/or preflight checks are being run (now automatic as soon as user clicks "export").
  • When the results of the preflight check are completed, the wizard shows "Ready to export" and the spinner transitions to the export icon

@cfm cfm closed this as completed in #1777 Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants