fix: Incorrect handling of events-[INS-779] - #8876
Merged
Merged
Conversation
CurryYangxx
force-pushed
the
fix/sse-connection
branch
from
July 17, 2025 07:15
a3a25a5 to
8349ccc
Compare
ZxBing0066
approved these changes
Jul 17, 2025
Comment on lines
+79
to
+94
| const isSameWorkspaceWithRemote = (workspaceId: string | undefined, remoteWorkspaceId: string | undefined) => { | ||
| if (!workspaceId || !remoteWorkspaceId) { | ||
| return false; | ||
| } | ||
| const vcs = VCSInstance(); | ||
| const currentBackendProject = vcs.getActiveBackendProject(); | ||
| if ( | ||
| currentBackendProject && | ||
| currentBackendProject?.id === remoteWorkspaceId && | ||
| currentBackendProject.rootDocumentId === workspaceId | ||
| ) { | ||
| return true; | ||
| } | ||
| return false; | ||
| }; | ||
|
|
Member
There was a problem hiding this comment.
It could be simpler.
Suggested change
| const isSameWorkspaceWithRemote = (workspaceId: string | undefined, remoteWorkspaceId: string | undefined) => { | |
| if (!workspaceId || !remoteWorkspaceId) { | |
| return false; | |
| } | |
| const vcs = VCSInstance(); | |
| const currentBackendProject = vcs.getActiveBackendProject(); | |
| if ( | |
| currentBackendProject && | |
| currentBackendProject?.id === remoteWorkspaceId && | |
| currentBackendProject.rootDocumentId === workspaceId | |
| ) { | |
| return true; | |
| } | |
| return false; | |
| }; | |
| const isSameWorkspaceWithRemote = (workspaceId: string | undefined, remoteWorkspaceId: string | undefined) => { | |
| const vcs = VCSInstance(); | |
| const currentBackendProject = vcs.getActiveBackendProject(); | |
| if ( | |
| workspaceId && remoteWorkspaceId && | |
| currentBackendProject?.id === remoteWorkspaceId && | |
| currentBackendProject?.rootDocumentId === workspaceId | |
| ) { | |
| return true; | |
| } | |
| return false; | |
| }; | |
| (event.type === 'FileChanged' || event.type === 'BranchDeleted') && | ||
| event.team === organizationId && | ||
| latestRemoteId.current && | ||
| event.project === latestRemoteId.current |
Member
There was a problem hiding this comment.
Could we reuse isSameWorkspace here?
CurryYangxx
force-pushed
the
fix/sse-connection
branch
2 times, most recently
from
July 21, 2025 09:30
1479bfb to
8d69384
Compare
CurryYangxx
force-pushed
the
fix/sse-connection
branch
from
July 22, 2025 03:01
8d69384 to
05101d0
Compare
RoamingLost
pushed a commit
to RoamingLost/insomnia
that referenced
this pull request
Aug 6, 2025
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.
Delete a workspace file, we don't need to sync projects
Add a new file or modify the file, we only need to submit
insomnia-sync/sync-dataaction when the current workspace is the same as the remote fileIf on the project page, revalidate to get new workspace list.
We only need to submit
insomnia-sync/sync-dataaction when the current workspace is the same as the remote file