bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Can't import a POSTMAN collection with a / char in the name

Open l0new4nder3r opened this issue 1 year ago • 10 comments

When attempting to import a postman collection with a name containing "/", the initial detection seems correct ("name" is correctly displayed), the import seems to be successful... "Collection imported successfully" is being displayed, but the collection is not imported at all (nothing in the destination folder, and no new collection opened in the main interface).

When looking at the dev console (postman collection called "MYAPP\SOMETHING ELSE", by example)

Uncaught (in promise) Error: Error invoking remote method 'renderer:import-collection': Error: ENOENT: no such file or directory, mkdir 'C:\Users\MY_USER\Documents\Bruno collections\MYAPP\SOMETHING ELSE'

Removing or replacing the "/" char leads to a successful import

l0new4nder3r avatar Sep 27 '23 09:09 l0new4nder3r

@l0new4nder3r The fix done by @tpyle has been released in v0.16.3

Can you test and confirm this on your end ?

helloanoop avatar Sep 29 '23 20:09 helloanoop

Hi, thanks @tpyle !

Successfully tested a few minutes ago with v0.16.4

Capture d’écran 2023-09-30 à 21 43 38

Testing with a postman collection containing a slash in its name property.

Capture d’écran 2023-09-30 à 21 42 10

Importing process (same as before, slash is still present)

Capture d’écran 2023-09-30 à 21 42 40

The collection is imported without issue - the only thing is that now, its name has changed. The slash has become an hyphen. Consistent with what I see in the commit, and at least it does not break!

Improvement with a much lesser priority : allow any character in the collection name?

l0new4nder3r avatar Sep 30 '23 19:09 l0new4nder3r

Hi @l0new4nder3r,

Unfortunately, since bruno stores collections (and requests) as files and directories, that requirement comes from the filesystem, not from bruno itself. Every filesystem that I'm aware of doesn't allow / in directory names or folder names, as it's used in UNIX-like OS's as a delimiter between directories.

I suppose we could URL encode the collection name (so that in the filesystem it looks like Collection%2FName, and then render it to the user as Collection/Name), but I feel like that's somewhat odd of behavior. What are your thoughts on this @helloanoop?

tpyle avatar Sep 30 '23 21:09 tpyle

Yes, Its a restriction at the filesystem level.

You can still choose to rename the collection in the UI and that will reflect in the UI. Meaning you can change it to Ex: "Payment/ConfigApi". This name gets updated in bruno.json which the UI will consume to render the name.

But in the filesystem level we are bounded by the naming restrictions of filesystem

bruno.json

{
  "version": "1",
  "name": "Payment/ConfigApi",
  "type": "collection"
  }
}

helloanoop avatar Sep 30 '23 22:09 helloanoop

Hey, I'm encountering similar issue here, but with different chars. I'm trying to import a postman collection with name [POC] XXX and when it's imported, I see a blank result in the IDE

irfansofyana avatar Oct 02 '23 02:10 irfansofyana

@irfansofyana can you tell me what OS you're on? Or what filesystem you're using, if you're aware? If you're on a linux/unix/mac system, you should be able to run df -T to tell.

tpyle avatar Oct 04 '23 12:10 tpyle

New user here. I name most of my requests after their route eg bruno/issues. Renaming collections works, but not requests. This is quite restrictive.

..but it looks like this is may just be a UI bug? If I manually change the name in the meta section of the request bru file, it is reflected in the UI. However, if I change it in the UI, it silently does nothing.

holycacao avatar Oct 04 '23 14:10 holycacao

Can confirm, there is something fishy with renaming requests via ui 🤔

DaPutzy avatar Oct 06 '23 22:10 DaPutzy

@irfansofyana can you tell me what OS you're on? Or what filesystem you're using, if you're aware? If you're on a linux/unix/mac system, you should be able to run df -T to tell.

Hi, I'm using macOS

irfansofyana avatar Oct 07 '23 12:10 irfansofyana

Can confirm, there is something fishy with renaming requests via ui 🤔

See also various other issues like #1336 and #1404, which are currently being solved in #349.

I am in favor of tracking the solution to the original problem (importing from Postman) in this issue.

ItsJustRuby avatar Mar 10 '24 09:03 ItsJustRuby