fix: unknow type in sync - #8703
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses sync issues when handling unknown model types between different versions. Key changes include:
- Adding a type check before upserting documents in the backend project sync logic.
- Enhancing the meta schema in the v5 import parser to ensure websocket request IDs follow the expected pattern.
- Logging a warning and gracefully handling cases when a database collection is missing.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/insomnia/src/sync/vcs/pull-backend-project.ts | Introduces a type guard on document upserts to prevent syncing issues. |
| packages/insomnia/src/common/import-v5-parser.ts | Adds a schema validation to ensure websocket request IDs start with "ws-req". |
| packages/insomnia/src/common/database.ts | Logs a warning and returns an empty result when the database collection is missing. |
Comments suppressed due to low confidence (1)
packages/insomnia/src/sync/vcs/pull-backend-project.ts:60
- [nitpick] Consider renaming 'allModelType' to 'allModelTypes' to more clearly indicate that it represents a collection of model types.
const allModelType = models.types();
CurryYangxx
force-pushed
the
fix/unknow-type-sync
branch
from
May 28, 2025 03:07
6e4f2a2 to
e0924e1
Compare
gatzjames
approved these changes
Jun 18, 2025
CurryYangxx
force-pushed
the
fix/unknow-type-sync
branch
from
June 19, 2025 06:04
e0924e1 to
a6018ee
Compare
CurryYangxx
enabled auto-merge (squash)
June 19, 2025 06:09
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.
Background
This is a fix for sync between different versions(The new version includes new DB model types to sync).
When testing the new Socket.io feature, if we push the new commit that includes the socket.io request. Then we use an older version and pull, there are some unexpected behaviors
This pr can fix the 2 issues above, but when we check the diff in the older version, the new type request was deleted.

Consider whether this can be fixed or the user can be better prompted