Skip to content

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

bivant added 3 commits May 19, 2022 22:58
 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


// 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.

@bivant bivant force-pushed the fix_concurrent_retrieveProductRequest branch from 0c33030 to 72d7e96 Compare January 16, 2023 21:52
xhruso00 added a commit to xhruso00/SwiftyStoreKit that referenced this pull request May 26, 2025
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