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 concurrent retrieve product request #675

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bivant
Copy link

@bivant bivant commented May 19, 2022

Based on changes from #674
Test for concurrent retrieveProductRequest is very unstable - it crashes on read/write to the controller.inflightRequests and builder.request

 from azouts/master

Communicate deferred transactions to the app
Swift’s ownership rule is that a value can be simultaneously accessed by multiple readers or a single writer - https://developer.apple.com/forums/thread/682446?answerId=678850022#678850022
…rieveProductsInfo execution before fireCallbacks() by DispatchGroup - groupFire
@vapor-pawelw
Copy link

I also experienced these crashes, would be good to get this PR merged

@@ -49,7 +49,20 @@ class ProductsInfoController: NSObject {
}

// As we can have multiple inflight requests, we store them in a dictionary by product ids
private var inflightRequests: [Set<String>: InAppProductQuery] = [:]
private var _inflightRequests: [Set<String>: InAppProductQuery] = [:]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_ is a rudiment from obj_c. rename please without underscore.

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

Successfully merging this pull request may close these issues.

3 participants