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.

Function redeemKey() returns undefined SubID

See original GitHub issue

Somewhere late of the 22nd of June, redeemKey started returning { undefined: 'GameTitle' } for me as package(s). The game titles are correct, but the subid’s are not. I assumed it was because of the Summer Sale that just started, but it still hasn’t been resolved. I have this bug across devices. I don’t think there is anything wrong with the code. Even if the first line of the callback is console.log(packages); it prints the undefinied subid. Am I the only one with this issue? Or does it happen for others as well?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Ne3tCodecommented, Jul 1, 2017

Patch:

diff --git a/components/apps.js b/components/apps.js
index 42c2f1b..4484c1c 100644
--- a/components/apps.js
+++ b/components/apps.js
@@ -499,7 +499,8 @@ SteamUser.prototype.redeemKey = function(key, callback) {
 		var recipeDetails = BinaryKVParser.parse(body.purchase_receipt_info).MessageObject;
 		if (recipeDetails.LineItemCount > 0) {
 			recipeDetails.lineitems.forEach(function(pkg) {
-				packageList[pkg.PackageID] = pkg.ItemDescription;
+				var packageID = pkg.PackageID || pkg.packageID || pkg.packageid;
+				packageList[packageID] = pkg.ItemDescription;
 			});
 		}

Also https://github.com/DoctorMcKay/node-steam-user/pull/36#issuecomment-164859965

0reactions
Revadikecommented, Jul 2, 2017

Look at that! It actually worked 😄 I guess it’s similar to appinfo.type sometimes being “Game” and sometimes being “game”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Variable of function always returns undefined - Stack Overflow
I want to return a variable from a function and then output it using console.log() . The problem: I can't just use return...
Read more >
Steam Batch Redeem Keys for Tampermonkey · GitHub
return ;. } else if (data.purchase_result_details !== undefined ... function setUnusedKeys(key, success, reason, subId, subName) { ... redeemKey(key);.
Read more >
Defining a function that returns "undefined" if its value is ...
I want to define a function f(x) which: ... but if f(x) is a complicated and long expression, then the code is very...
Read more >
AuTo Redeem Steamkey - Source code - Greasy Fork
makeArray($jQuery(htmlEl).children().map(function () {; return $jQuery(this).text(); })) ... else {; rowObject.append('<td><code>' + subId + '</code> <a ...
Read more >
Understanding Undefined Value returned from a Function
In this basic JavaScript tutorial, we explore the concept of a function running without a return method inside. This is part of the...
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