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

Fix RCTImageCache on macOS #1272

Merged
merged 1 commit into from
Aug 9, 2022
Merged

Conversation

christophpurrer
Copy link

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

The cache's totalCostLimit and the _cacheStaleTimes ivar were not getting set for Mac, presumably due to a merge mistake. I'm not sure what (if any) positive impact this will realistically have on memory consumption.

Changelog

[macOS] [Fixed] - Fix RCTImageCache on macOS

Test Plan

Tested rn-tester scrolling through several threads with lots of images. Everything works well.

@christophpurrer christophpurrer requested a review from a team as a code owner July 22, 2022 01:38
The cache's `totalCostLimit` and the `_cacheStaleTimes` ivar were not getting set for Mac, presumably due to a merge mistake. I'm not sure what (if any) positive impact this will realistically have on memory consumption.

Tested rn-tester scrolling through several threads with lots of images. Everything works well.
@Saadnajmi
Copy link
Collaborator

We did some investigating, and the original ifdef to not clear the cache on macOS seems to be because we only clear the cache for iOS specific notifications / concerns. That doesn't mean we can't have a limit on macOS, so this change seems good to merge :)

@Saadnajmi Saadnajmi merged commit 3ebfa69 into microsoft:main Aug 9, 2022
@Saadnajmi Saadnajmi mentioned this pull request Aug 9, 2022
4 tasks
@christophpurrer
Copy link
Author

Thanks for reviewing this one and for the detailed feedback

shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Feb 13, 2023
The cache's `totalCostLimit` and the `_cacheStaleTimes` ivar were not getting set for Mac, presumably due to a merge mistake. I'm not sure what (if any) positive impact this will realistically have on memory consumption.

Tested rn-tester scrolling through several threads with lots of images. Everything works well.

Co-authored-by: Scott Kyle <skyle@fb.com>
shwanton pushed a commit to shwanton/react-native-macos that referenced this pull request Mar 10, 2023
The cache's `totalCostLimit` and the `_cacheStaleTimes` ivar were not getting set for Mac, presumably due to a merge mistake. I'm not sure what (if any) positive impact this will realistically have on memory consumption.

Tested rn-tester scrolling through several threads with lots of images. Everything works well.

Co-authored-by: Scott Kyle <skyle@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants