feat: load all workspace of a org in one batch#9934
Open
xiaodemen wants to merge 1 commit into
Open
Conversation
| result.set(projectId, files); | ||
| } | ||
| } catch (error) { | ||
| console.error(`Failed to fetch unsynced files for organization ${organizationId}`, error); |
✅ Circular References ReportGenerated at: 2026-05-28T10:45:20.781Z Summary
Click to view all circular references in PR (15)Click to view all circular references in base branch (15)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
542eaf9 to
37ca1c9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements an org-wide (team-wide) batch fetch for remote backend projects/workspaces so the UI can load “unsynced” remote workspaces for all cloud-sync projects with a single backend call rather than per-project requests.
Changes:
- Update the Project Navigation Sidebar to fetch all remote backend projects for an org in one request and group them by local project.
- Add a new sync bridge method (
remoteBackendProjectsOfTeam) backed by a new GraphQL query path inVCS. - Introduce a helper (
getAllRemoteBackendProjectsOfOrg) and a new backend project type to support the new payload.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/insomnia/src/ui/components/sidebar/project-navigation-sidebar/project-navigation-sidebar.tsx | Switch unsynced remote workspace loading from per-project fetching to a single org-wide fetch and grouping. |
| packages/insomnia/src/sync/types.ts | Add a backend project type that includes teamProjectId for grouping results per local project. |
| packages/insomnia/src/main/cloud-sync/ipc.ts | Extend the sync bridge typings with the new remoteBackendProjectsOfTeam method. |
| packages/insomnia/src/main/cloud-sync/core/vcs.ts | Implement remoteBackendProjectsOfTeam GraphQL query and map results for renderer consumption. |
| packages/insomnia/src/entry.preload.ts | Expose remoteBackendProjectsOfTeam to the renderer via the preload bridge. |
| packages/insomnia/src/common/project.ts | Add a renderer-side helper to call the new sync bridge method using organizationId. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
11
to
16
| import { | ||
| getAllRemoteBackendProjectsByProjectId, | ||
| getAllRemoteBackendProjectsOfOrg, | ||
| getUnsyncedRemoteWorkspaces, | ||
| type InsomniaFile, | ||
| } from '~/common/project'; |
Comment on lines
+236
to
+243
| return projects.map(backend => ({ | ||
| id: backend.id, | ||
| name: backend.name, | ||
| rootDocumentId: backend.rootDocumentId, | ||
| teamProjectId: backend.teamProjectId, | ||
| // A backend project is guaranteed to exist on exactly one team | ||
| team: backend.teams[0], | ||
| })); |
37ca1c9 to
d7631ba
Compare
cwangsmv
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
INS-2359