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

Request missing tokens for owned packages and include free promotions #378

Merged
merged 28 commits into from
Feb 24, 2022

Conversation

Revadike
Copy link
Contributor

Continuation of #352

Resolves #351

@Revadike Revadike changed the title Patch 3 Request missing tokens for owned packages and include free promotions Oct 10, 2021
@DoctorMcKay DoctorMcKay merged commit ce0e0a2 into DoctorMcKay:master Feb 24, 2022
@Revadike Revadike deleted the patch-3 branch February 24, 2022 06:09
@Revadike
Copy link
Contributor Author

Revadike commented Feb 24, 2022

@DoctorMcKay Thanks again for merging this PR. Some closing remarks:

  • Anonymous session hasn't really been tested, I think.
  • The documentation still has to be updated:
    • getOwnedX and ownsX now uses filter as parameter (but still supports old syntax and behavior (<= v4.22.0))
    • getOwnedLicenses has been added (can be called after licenses event), separating the definitions of owned packages and owned licenses. Licenses are all the packages tied to the account. Owned packages are licenses without expired (and shared & temporary) licenses.
    • Methods relating to package ownership now can no longer be safely called until appOwnershipCached is emitted when a (default) filter is supplied, else it reverts to old behavior (returns all owned licenses ids). More info
  • appOwnershipCached should perhaps be renamed to plainly ownershipCached as it is needed for packages too now
  • I can't think of situations where don't you want to request missing tokens for getProductInfo, so maybe it should request missing tokens by default (set inclTokens by default to true), unless explicitly disallowed.
  • As I mentioned earlier in our discord conversation, this seems to happen on occasion, but I'm not sure why. It should be investigated.

@Revadike
Copy link
Contributor Author

Revadike commented Mar 9, 2022

I just happened to test anonymous ownershipcache and I get an error:

\node_modules\steam-user\components\apps.js:564
                let packageids = this.licenses.map(license => license.package_id);
                                               ^

TypeError: Cannot read properties of null (reading 'map')
    at SteamUser._getLicenseInfo (\node_modules\steam-user\components\apps.js:564:34)
    at SteamUser.<anonymous> (\node_modules\steam-user\components\08-logon.js:538:10)
    at \node_modules\steam-user\components\classes\HandlerManager.js:35:12
    at Array.forEach (<anonymous>)
    at HandlerManager.emit (\node_modules\steam-user\components\classes\HandlerManager.js:34:12)
    at SteamUser._handleMessage (\node_modules\steam-user\components\03-messages.js:635:25)
    at SteamUser._handleNetMessage (\node_modules\steam-user\components\03-messages.js:556:8)
    at SteamUser._processMulti (\node_modules\steam-user\components\03-messages.js:687:9)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

@DoctorMcKay
Copy link
Owner

I just happened to test anonymous ownershipcache and I get an error:

79388be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inaccurate getOwnedApps
2 participants