Skip to content

Solve the bug related to importing multiple workspaces in one file [INS-5077]#8442

Merged
yaoweiprc merged 4 commits into
developfrom
fix/import-error
Mar 18, 2025
Merged

Solve the bug related to importing multiple workspaces in one file [INS-5077]#8442
yaoweiprc merged 4 commits into
developfrom
fix/import-error

Conversation

@yaoweiprc

@yaoweiprc yaoweiprc commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

Close #8424
If the user imports a file containing more than one workspace, we create a new workspace for each workspace in the file. Then, all resources in the file are added to all newly created workspaces, regardless of whether they belong to the workspace.
That is why the 'Error: New Requests missing parentId' showed up.

Now we check whether a resource belongs to a workspace before it's added to the workspace.

@yaoweiprc yaoweiprc marked this pull request as draft March 7, 2025 13:42
@yaoweiprc yaoweiprc changed the title Solve the bug that it imports all resources to all workspaces when th… [INS-5077] Solve bug related to importing multiple workspaces in one file [INS-5077] Mar 7, 2025
@yaoweiprc yaoweiprc changed the title Solve bug related to importing multiple workspaces in one file [INS-5077] Solve the bug related to importing multiple workspaces in one file [INS-5077] Mar 7, 2025
@yaoweiprc yaoweiprc marked this pull request as ready for review March 11, 2025 03:28
@yaoweiprc yaoweiprc requested a review from jackkav March 11, 2025 03:28
@yaoweiprc yaoweiprc force-pushed the fix/import-error branch 2 times, most recently from 4f6b3e3 to 032c079 Compare March 13, 2025 06:40
@yaoweiprc yaoweiprc requested a review from a team March 13, 2025 06:57
ryan-willis
ryan-willis previously approved these changes Mar 13, 2025

@ryan-willis ryan-willis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the filtering/traversal code is a bit if a brain teaser, but I trust you

Comment thread packages/insomnia/src/common/import.ts
filfreire
filfreire previously approved these changes Mar 14, 2025
Comment thread packages/insomnia-smoke-test/tests/smoke/import.test.ts Outdated
Comment thread packages/insomnia/src/common/import.ts Outdated
Comment thread packages/insomnia/src/common/import.ts
Comment thread packages/insomnia/src/common/import.ts Outdated
Comment thread packages/insomnia/src/common/import.ts
@yaoweiprc yaoweiprc dismissed stale reviews from filfreire and ryan-willis via 97111cd March 18, 2025 06:19
@yaoweiprc yaoweiprc force-pushed the fix/import-error branch 2 times, most recently from ca4e22f to 95fd57b Compare March 18, 2025 09:09
@yaoweiprc yaoweiprc enabled auto-merge (squash) March 18, 2025 11:30
@yaoweiprc yaoweiprc merged commit cd1625a into develop Mar 18, 2025
@yaoweiprc yaoweiprc deleted the fix/import-error branch March 18, 2025 12:03
cwangsmv pushed a commit that referenced this pull request Apr 21, 2025
…NS-5077] (#8442)

* Solve the bug that it imports all resources to all workspaces when there are multiple workspaces in one imported file

* add smoke test

* Apply suggestions from code review

Co-authored-by: James Gatz <jamesgatzos@gmail.com>

* Use import-from-clipboard instead of import-from-file in smoke test

---------

Co-authored-by: James Gatz <jamesgatzos@gmail.com>
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.

Import of Collections results in Error: New Requests missing parentId

5 participants