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

[iOS] promisesByKey is not thread-safe #106

Closed
lwansbrough opened this issue Apr 9, 2018 · 5 comments
Closed

[iOS] promisesByKey is not thread-safe #106

lwansbrough opened this issue Apr 9, 2018 · 5 comments
Assignees
Labels
🐛 bug Something isn't working 📱 iOS Related to iOS

Comments

@lwansbrough
Copy link
Contributor

Version of react-native-iap

0.3.0-beta3

Expected behavior

This dictionary can be accessed by multiple threads at the same time

Actual behavior

This dictionary crashes when accessed by multiple threads at the same time.

Steps to reproduce

Hard to reproduce, but here's a log:

screen shot 2018-04-09 at 1 40 44 pm

The fix would probably be a semaphore or lock inside those add/remove methods.

@lwansbrough lwansbrough added the 🐛 bug Something isn't working label Apr 9, 2018
@lwansbrough
Copy link
Contributor Author

FYI I'm not working on a fix for this right now.

@JJMoon
Copy link
Contributor

JJMoon commented Apr 26, 2018

Thank you for your help. I will check.

@JJMoon
Copy link
Contributor

JJMoon commented May 4, 2018

@lwansbrough Looks like you got this error when you restore non-consumable purchases.
I think I got it.
It would happen when restoring failed. It calls rejectPromisesForKey method twice. And sometimes it throws exception.
I guess removing the method in restoreCompletedTransactionsFailedWithError would work. I hope you give me an opinion.

@JJMoon JJMoon added the 📱 iOS Related to iOS label May 18, 2018
@JJMoon
Copy link
Contributor

JJMoon commented May 18, 2018

@lwansbrough I added some sync queue to manage the actions. I hope you check the source. It's on the PR.

@JJMoon
Copy link
Contributor

JJMoon commented May 19, 2018

This issue is applied on 1.0.4.

@hyochan hyochan closed this as completed May 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 📱 iOS Related to iOS
Projects
None yet
Development

No branches or pull requests

3 participants