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

client.logOff() not working after calling client.getProductInfo() #338

Closed
osztenkurden opened this issue Jan 22, 2021 · 1 comment
Closed
Labels

Comments

@osztenkurden
Copy link

osztenkurden commented Jan 22, 2021

Describe the bug

client.logOff() not working after calling client.getProductInfo(), not going back to bash after running node index.js

Versions

4.19.2 and 14.4.0 of Node

Code example

const SteamUser = require('steam-user');
const getAppInfo = (appId) => new Promise((res, rej) => {
    var client = new SteamUser();

    client.on('loggedOn', async () => {
        const gameData = await client.getProductInfo([appId], [])
        const gameInfo = gameData?.apps?.[`${appId}`]?.appinfo;
        console.log("Logging off of Steam");
        client.logOff();
        res(gameInfo);
    });
    
    client.logOn();
});

getAppInfo(730).then(() => console.log("done"));

The Promise is resolved, but session is still going, meaning after running node index.js it will not go back to bash.

This example however logs off properly and imidiately:

const SteamUser = require('steam-user');
const getAppInfo = (appId) => new Promise((res, rej) => {
    var client = new SteamUser();

    client.on('loggedOn', async () => {
        console.log("Logging off of Steam");
        client.logOff();
        res(null);
    });
    
    client.logOn();
});

getAppInfo(730).then(() => console.log("done"));

client._disconnect(true) also doesn't work

@DoctorMcKay
Copy link
Owner

Fixed in v4.19.3.

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

No branches or pull requests

2 participants