Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix new property in request causes existing request show as modified in git sync [INS-4511] #8021

Merged
merged 3 commits into from
Sep 29, 2024

Conversation

cwangsmv
Copy link
Contributor

@cwangsmv cwangsmv commented Sep 27, 2024

Background
Currently, When we add a new property to models like Request, we will add the default value of this property in model init method. Otherwise the new property can not be updated due to current design in database.update method which will check if updated keys is valid.

But this will cause all existing models show as modified in git sync, due to current implementation of using YAML stringify method to compare local db content with git origin content. The YAML stringify method will add a new property to the yaml file even the value is undefined.

Solution
Instead of adding a new property to request, I have moved the logic to detect if a GraphQL request operation is subscription or not into request model, so no more extra property is needed

ihexxa
ihexxa previously approved these changes Sep 29, 2024
packages/insomnia/src/utils/graph-ql.ts Outdated Show resolved Hide resolved
@cwangsmv cwangsmv force-pushed the fix/remove-extra-field-in-response branch from 10236a4 to ac6f11b Compare September 29, 2024 07:36
@cwangsmv cwangsmv enabled auto-merge (squash) September 29, 2024 07:36
@cwangsmv cwangsmv merged commit 01402b5 into develop Sep 29, 2024
8 checks passed
@cwangsmv cwangsmv deleted the fix/remove-extra-field-in-response branch September 29, 2024 07:47
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.

2 participants