httptoolkit / httptoolkit-desktop

Electron wrapper to build and distribute HTTP Toolkit for the desktop
https://httptoolkit.com
GNU Affero General Public License v3.0
615 stars 83 forks source link

App download does not work without internet on first run #27

Closed working-name closed 3 years ago

working-name commented 3 years ago

The UI doesn't seem to load without access to the network. What does the app download contain, if it doesn't contain the UI?

Screen Shot 2021-05-16 at 1 41 21 PM

pimterry commented 3 years ago

Thanks for the feedback (I've updated the text to focus on the issue itself).

The app download contains a) yes, Electron, b) the backend server, and c) the glue to start that, connect to it from the UI, and handle various error cases. If you're interested in how this all hooks together then there's more detail in the README.

The UI itself is loaded and updated from the network, primarily to ensure that it's easy to update as a tiny download, without rebuilding, rereleasing & redownloading the whole binary for every change. Network connectivity is generally a safe bet here, since it's a networking tool, so it's not much use without internet access anyway. After the first run the latest UI is cached in a service worker, so you don't need any network connectivity to start the app later on.

I'm open to bundling a recent version of the UI with the desktop build, but it's difficult to do cleanly and it's rarely an issue, so it's not a high priority for me right now. If you're interested and you want to open a PR though I'm happy to review it. Note that HTTP Toolkit Pro is totally free for all open-source contributors.

Alternatively, it sounds like you might just not like Electron? Electron isn't strictly required, it's just the default for distribution & consistent deployment behaviour. If you'd prefer you can instead download & run the server directly (from https://github.com/httptoolkit/httptoolkit-server/releases or via npm) and then open the UI via https://app.httptoolkit.tech in any Chromium browser or in Firefox. See https://httptoolkit.tech/docs/guides/troubleshooting/#i-hate-electron

working-name commented 3 years ago

I see, makes sense, I'll give it another shot one these days.

I'm not at all against Electron, it just took me by surprise to see a white screen. It might be worth your time to have a default notice on there which would be replaced by the actual UI bundle once it's available. Something to the effect of "Waiting to download first time only bundle...". Hopefully that's a lot less headache in terms of management.

I don't know if I have the skill for a PR but will look into it.

As you most likely know there's a lot of bait&switch out there in terms of software. Advertised as doing X and Y, then you run it and find out what the fine print really was. Definitely judged your software too harshly especially for not having actually run it (didn't let it download its bundle).

Thanks again!