fix(Sync): Do not show conflicts for empty keys#7556
Merged
gatzjames merged 4 commits intoKong:developfrom Jun 19, 2024
Merged
Conversation
cfdc831 to
3df24ed
Compare
dd47441 to
d0b69ad
Compare
9fe5d03 to
1c37535
Compare
jackkav
reviewed
Jun 19, 2024
Comment on lines
+271
to
+273
| const stringifiedData = JSON.stringify(data); | ||
| if (format.toLowerCase() === 'yaml') { | ||
| return YAML.stringify(data); | ||
| return YAML.stringify(JSON.parse(stringifiedData)); |
Contributor
There was a problem hiding this comment.
this looks like it might be a regression
jackkav
approved these changes
Jun 19, 2024
stefancruz
pushed a commit
to stefancruz/insomnia
that referenced
this pull request
Jun 30, 2024
* Remove keys that have empty values and can be undefined in a model * only scripts can be undefined for now * New fields are now initialized as undefined * update tests
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.
Highlights:
Problem:
e.g.
Previous version of object:
{ "id": "1", }New version of object:
{ "id": "1", "newProp": undefined }This should not show up in changes that need to be commited.
Approaches Tested:
Use the VCS to compare against the previous version of an object.
Only update properties of objects in the database if the value of a key is not empty for keys that have a default undefined value
Only handle this for new keys. New keys can be defined as optional.
Comparison between the two approaches:
✅ After discussion with the team we decided to go with the last approach: Models (new keys should be optional and default to undefined)