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

Show an error message when pcap slices can't be opened #3114

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

philrz
Copy link
Contributor

@philrz philrz commented Jun 25, 2024

tl;dr

Per #1379, we've had problems on some platforms when a user clicks Download Packets and there's no application installed to open the extracted slice, e.g., Wireshark. Though we've merged some changes over time that have helped us improve in this area, this change covers us for Linux where the problem is still significant.

Fixes #1379

Details

As of the most recent update in #1379 (comment), Zui actually gets decent help here from the OS on both macOS and Windows since in those cases the OS pops up a notification about the lack of a helper app for pcaps. However, on Linux the user would still see just the Packets extracted. Opening... message from Zui, no launched pcap app, and no other guidance, so there was still room for improvement there.

I pursued an angle advocated in #1379 (comment) of researching what's returned by the function call to open the pcap helper app, which is currently Electron's shell.openPath(). What I found is that it does sometimes return an error message in the absence of a helper app, though it's not the most helpful. Specifically:

OS Message
macOS "Failed to open path"
Linux "The action failed"
Windows (no message returned)

Because these messages are pretty vague, in the branch for this PR I'm instead opting to display the more explicit error message Could not open extracted pcap. Is Wireshark installed? Granted, in theory a user could install a different pcap helper app instead of Wireshark, but it seems like 99% of our users think of Wireshark here, and if a user is advanced enough to be seeking alternate helper app I imagine they'll get the essence of what the message is implying and install the app of their choosing.

The fact there's no message returned at all on Windows is annoying, but since we have the OS pop-up to cover us there, I'm not inclined to get obsessed.

Tests

Using a Dev build generated from this branch, here's video on each OS showing evidence of the failure case (no Wireshark installed) and success case (just to confirm we've not disturbed what was already working ok).

Linux

Failure

This is the main benefit we're getting here, since the user now sees our error message instead of the silence from before.

Linux-fail.mp4

Success

Linux-success.mp4

Windows

Failure

Because shell.openPath() returns no error message here, we rely on the OS to inform the user.

Windows-fail.mp4

Success

Windows-success.mp4

macOS

Failure

Here we get the "belt & suspenders" benefit of both the error message from Zui and the pop-up from the OS.

macOS-fail.mp4

Success

macOS-success.mp4

@philrz philrz requested a review from jameskerr June 25, 2024 18:02
@philrz philrz self-assigned this Jun 25, 2024
Copy link
Member

@jameskerr jameskerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes good sense to me.

@philrz philrz merged commit 6a90407 into main Jul 2, 2024
8 checks passed
@philrz philrz deleted the msg-no-wireshark branch July 2, 2024 18:02
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.

Provide guidance on macOS/Linux when no app is tied to opening of pcaps
2 participants