insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Cannot import resources to existing workspace via `context.data.import.raw`

Open s-takehana opened this issue 1 year ago • 0 comments

Expected Behavior

Import resources to existing workspace.

Actual Behavior

Cannot import resources to existing workspace.

Reproduction Steps

      await context.data.import.raw(
        JSON.stringify({
          _type: "export",
          __export_format: 4,
          resources: [
            {
              _id: "wrk_1",
              name: "New workspace",
              _type: "workspace",
            },
            {
              _id: "req_1",
              method: "GET",
              name: "Test request(New workspace)",
              parentId: "wrk_1",
              url: "https://insomnia.rest",
              _type: "request",
            },
            {
              _id: "req_0",
              method: "GET",
              name: "Test request(Existing workspace)",
              parentId: models.workspace._id,
              url: "https://insomnia.rest",
              _type: "request",
            },
          ],
        })
      );

wrk_1 and req_1 are created. But req_0 is not created anywhere.

context.data.import.raw https://github.com/Kong/insomnia/blob/018d7dee70b1b29ed372c96d51a721f04c70db74/packages/insomnia/src/plugins/context/data.ts#L46-L57

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

2023.4.0

What operating system are you using?

Windows

Operating System Version

Windows 11 22H2

Installation method

download from insomnia.rest

Last Known Working Insomnia version

No response

s-takehana avatar Jul 08 '23 09:07 s-takehana