-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
feat(dataReducer): revert merged data removal #324
base: main
Are you sure you want to change the base?
feat(dataReducer): revert merged data removal #324
Conversation
Codecov Report
@@ Coverage Diff @@
## master #324 +/- ##
==========================================
+ Coverage 89.98% 90.00% +0.01%
==========================================
Files 19 19
Lines 629 630 +1
==========================================
+ Hits 566 567 +1
Misses 63 63
Continue to review full report at Codecov.
|
@@ -88,7 +88,7 @@ describe('dataReducer', () => { | |||
`${collection}.${doc}.newData.field`, | |||
data[doc].newData.field, | |||
); | |||
expect(result).to.not.have.nested.property( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was in place for a reason - not removing a value which is removed from the object will cause stale data in certain situations
@@ -59,11 +59,13 @@ export default function dataReducer(state = {}, action) { | |||
state, | |||
); | |||
} | |||
// Otherwise merge with existing data | |||
const mergedData = assign(previousData, data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will prevent removing a param from an object that is removed elsewhere - what is the goal here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR is meant to revert back an existing functionality that has been later removed (while kept in rrf - firebase), data merging.
When for a given collection you change the query to fetch new data (or next page for that matters) new data should be merged with existing data, at the moment is getting replaced.
What the PR is doing is just reverting back the files to their previous status (as mentioned in the issue open #294)
Description
Check List
If not relevant to pull request, check off as complete
Relevant Issues
#294