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

test(queryCache): add failing test for partially undefined key (#3741) #4616

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Dec 9, 2022

  1. test(queryCache): add failing test for partially undefined key (TanSt…

    …ack#3741)
    
    The current behavior when using functions such as invalidateQueries or setQueriesData
    is unexpected when objects with undefined properties are involved.
    
    A key containing an object with an undefined property is hashed without the undefined property,
    yet the property is considered in the partialDeepEqual function.
    
    This creates some confusing scenarios, as demonstrated in the discussion on TkDodo's blog
    <TkDodo/blog-comments#71 (comment)> and in the
    referenced issue
    
    This commit includes a failing test to demonstrate the expected behavior
    maxandron committed Dec 9, 2022
    Configuration menu
    Copy the full SHA
    e5a507c View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2022

  1. test(queryCache): make failing test more representative

    Usually users won't pass `undefined` explicitly into an object but
    rather use it an optional function parameter (e.g. to a custom hook)
    maxandron committed Dec 10, 2022
    Configuration menu
    Copy the full SHA
    719c518 View commit details
    Browse the repository at this point in the history