question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BAD CONSUMPTION FUNCTIONALITY!!

See original GitHub issue

refreshAllItems is very poorly named!! The implementation uses fetchHistory on iOS which is non-mutative operation, and uses consumeItem on Android, which destroys purchase history! This is either very bad naming, or very poor purchase flow behaviour! I’ll nominate it for both!

I can’t think of a single case where I’d want to immediately consume all purchased items. What I would expect is that refreshAllItems re-synchronizes the device purchase history with Google Play and the App Store (ie. getPurchases) – this should absolutely be changed so more people don’t make this mistake.

I even checked the source code to make sure I had the right idea about what was going on, but I got as far as getPurchases on the Android side and stopped reading. I didn’t notice this module was automatically consuming those purchases!!

Here’s my suggestion for a fix: rename refreshAllItems to refreshPurchases, and ONLY fetch the user’s purchase history. Do NOT consume items automatically. Consuming behaviour is it’s own flow which should be managed by the application developer, ie explicitly calling consumeItem(...) or something similar.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
javier-artilescommented, Mar 9, 2018

@dooboolab No worries, I know it can be hard to balance personal and day job projects. Will start by spending some time reading through the codebase, @lwansbrough fork, and currently reported issues.

1reaction
hyochancommented, Mar 9, 2018

@javier-artiles You can see the remaining issues in this repo. Testing local receipt validation might be useful too. Also, before all that, we need to test @lwansbrough code and update readme and announce users for migration who’s already using our module. I am running out of time and testing is bit delayed. Sorry for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

(PDF) Good, bad consumption- Paradigm development of ...
In this article I try to reveal some “mental turns” or paradigm shifts that have taken place in. consumer research in Finland during...
Read more >
Utility Function with a Bad Good - YouTube
Utility Function with a Bad Good. 2.2K views 2 years ago Consumer ... A.1 Utility function | Consumption - Microeconomics. Policonomics.
Read more >
Explaining the Poor Performance of Consumption-Based ...
One can always argue in principle that perhaps the utility function is mis- specified, but it is hard to believe that plausible changes...
Read more >
Equity and Equity Risk Premium - AnalystPrep
The equity risk premium is the reward to investors over and above the compensation for risk required for holding a risk-free government bond....
Read more >
Drinking too much alcohol can harm your health. Learn the facts
Excessive alcohol use can lead to increased risk of health problems such as injuries, violence, liver diseases, and cancer.The CDC Alcohol Program works...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found