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

High CPU when navigating away from view with the RequestReviewAction #146

Closed
byaruhaf opened this issue Aug 14, 2023 · 2 comments
Closed

Comments

@byaruhaf
Copy link

byaruhaf commented Aug 14, 2023

I have integrated this package into my application, and I've been working on implementing the "Request Review" feature. However, each time I navigate away from the screen containing the @Environment(\.requestReview) property to a screen using @Default(.localSavedStudents), the screen freezes, and I've noticed that the CPU usage exceeds 100%.

You can access a sample project using the link below, with code that you can run to recreate this issue.

https://github.com/byaruhaf/DefTest

is there some hidden interaction between Defaults & StoreKit?

Because if comment out either

`@Environment(\.requestReview) private var requestReview`

or
@Default(.localSavedStudents) var localSavedStudents

The problem is resolved, using both however the problem returns.

High CPU

image

Increasing Memory

image
@sindresorhus
Copy link
Owner

I can reproduce the issue even without @Default. Try replacing @Default(.localSavedStudents) var localSavedStudents with @ObservedObject var test = Test().

final class Test: ObservableObject {}

@byaruhaf
Copy link
Author

oops, sorry my bad didn't think to test that.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants