Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.33k stars 1.93k forks source link

Error when cloning repository with no `.insomnia/` on the default branch #6102

Open APEX-JOAQUIN-ROVIRA opened 1 year ago

APEX-JOAQUIN-ROVIRA commented 1 year ago

Expected Behavior

Cloning a repository that does not contain an API spec in the default branch while it does exist in a non-default branch should load and allow to switch branches.

Actual Behavior

When cloning a repository with + Create > Git clone that contains an Insomnia API spec (.insomnia/) on a non-default branch (e.g. dev) and nothing on the default branch (i.e. main), the Insomnia desktop application shows the following error. I have not found a way to switch branches to the appropriate one from this window.

image

Clicking on Try to reload the app brings you back to the dashboard, but opening the associated document again will show the same window.

Reproduction Steps

I have published a minimum reproducible example in APEX-JOAQUIN-ROVIRA/TestRepo. This repository contains a main branch without an .insomnia/ directory. There is a non-default branch dev that contains an example API spec in the .insomnia/ directory.

Steps:

  1. Clone the repository with the + Create > Git clone menu option.
  2. Add any (valid) GitHub credentials as the repo is public.
  3. The error window will pop up.

Is there an existing issue for this?

Additional Information

Version: Insomnia 2023.4.0
Build date: 4/7/2023
OS: Windows_NT x64 10.0.19042
Electron: 23.3.9
Node: 18.12.1
V8: 11.0.226.20-electron.0
Architecture: x64

Insomnia Version

2023.4.0

What operating system are you using?

Windows

Operating System Version

Windows_NT x64 10.0.19042

Installation method

insomia.rest

Last Known Working Insomnia version

N/A

JohnZavyn commented 1 year ago

I am having the same issue on OS X. I have tried Git clone on both GitHub and Bitbucket (with an authentication token). I have also tried manually adding the /.insomnia folder in both environments without success.

Version: Insomnia 2023.4.0 Build date: 7/4/2023 OS: Darwin arm64 22.5.0 Electron: 23.3.9 Node: 18.12.1 V8: 11.0.226.20-electron.0 Architecture: arm64

Insomnia automatically creates a Document in the project, but the same application error appears when it is clicked.

pwbinder commented 1 year ago

I'm seeing the same issue, but here are some additional details.

The initial git clone leads to a Document automatically being created with the same error. Upon going through the git clone setup a second time, I am actually seeing the insomnia collection successfully being imported into the interface. However, if I exit out of the collection or the app itself, the collection no longer shows up in the project. The Document is still there with the same error if I click on it.

Version: Insomnia 2023.5.3 Build date: 8/16/2023 OS: Windows_NT x64 10.0.19044 Electron: 25.2.0 Node: 18.15.0 Node ABI: 116 V8: 11.4.183.23-electron.0 Architecture: x64

I am trying to clone from a Bitbucket repository via http.