What you were expecting:
When switching between resources in the menu, the filterDefaultValues prop should not be merged.
What happened instead:
The filter prop is shared and thus during navigation they are stacking between the different resources.
Steps to reproduce:
1) Create a <List> of A

2) Create a <List> of B

3) Go to /A
This will trigger this query:

4) Go to B

A's filterDefaultValues were merged with B's
Demo: https://w7r6ypn47k.codesandbox.io/#/posts
Code: https://codesandbox.io/s/w7r6ypn47k
(Click on Comments)

Environment
@fzaninotto Maybe we should store list filters by resources ?
Thanks for the codesandbox, it confirms the bug. Marking it as such.
@djhi you're right, obviously.
I thought we still had list params in a reducer shared among resources but no, list params are already by resource.
After some digging it seems the issue lies in the resource reducer initialization but I can't figure out why yet.
It would certainly be interesting to let users put filters values to null from a URL.
instead of:
https://github.com/marmelab/react-admin/blob/a1b27c4c21d70e94954441b26ceeaf9e848034c6/packages/ra-core/src/controller/ListController.js#L145-L146
if we do it like this that would allow this behaviour
if (!query.filter.hasOwnProperty(name)) {
query.filter[name] = filterDefaultValues[name];
}
Our use case: we have a ReferenceManyField with a Preview button which is a component redirecting the user to the List view with a certain filter (call it A). But the filterDefaultValues of the List are in conflict with filter A. The user needs to remove filter B to see the same results that in ReferenceManyField.
Fixed by #2019. Will be available in 2.1.3
Most helpful comment
Thanks for the codesandbox, it confirms the bug. Marking it as such.
@djhi you're right, obviously.