-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Static props prevents selectors recall #100
Comments
Thanks for reporting. We would need a test case to fix the bug. |
Looks it fails with any string when this string not changed between calls. |
Not only strings. Also numbers and |
We have some double selector tests, but the coverage may not be enough. I'm not sure if that helps. |
Reproduced
Second |
Thanks for the reproduction. #101 adds the test case. |
#101 should fix. Please try: |
I use yarn 4 so used This case fixed, thanks 🎉 But my initial problem still exists 😢 I'll back if will find way to create a repro. |
You can start from this Simplified example
Second expected output is |
Here is extended example which more close to my problem Extended example
Third expected output is Strange that if use |
Okay, let me merge #101 and tackle the new one separately.
Can you simplify it a bit more? |
* add failing test for #100 * fix it!!! * update test desc * update CHANGELOG
I simplified as possible |
Yeah, but my gut feeling is there should be a smaller repro to reveal the bug. Maybe, it has to be created from a different angle, instead of simplifying the current code. |
I haven't read it very carefully yet, but one possibility is double nested memoize works, but triple nested memoize can fail. |
You can try to remove something then bug will stop to reproduce
Rare case. Was difficult to find related selectors and call in right order. Simplified as possible and anonymized data.
Should be easy to read on books example
Better if selectors will be recalled than return wrong data |
Done: #102 |
Please open a new issue if you still find a bug. |
Cool, I tested, all problems fixed, looks good, thank you! 🎉 |
That's great to hear. FYI, here's the simplified repro: proxy-memoize/tests/issue_100.spec.ts Lines 53 to 87 in e2aa105
|
Hey, I have reproducible problem on big project but I still can't create small example.
Essence of the problem:
proxy-memoize
detects changes in the selector and recall as expected.But if this selector will additionally use some string like
state.books[id].priceString
(wherepriceString
is'0'
) thenproxy-memoize
doesn't recall this selector.Additional info:
Selector uses another memoized selector. If don't memoize internal selector then no problems with
'0'
strings.Any ideas?
The text was updated successfully, but these errors were encountered: