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

태블릿으로 로그인시 몇분뒤 연결이 끊김 #149

Closed
nunnu1028 opened this issue Feb 17, 2021 · 4 comments
Closed

태블릿으로 로그인시 몇분뒤 연결이 끊김 #149

nunnu1028 opened this issue Feb 17, 2021 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@nunnu1028
Copy link

nunnu1028 commented Feb 17, 2021

Describe the bug
태블릿으로 로그인시 몇분뒤 연결이 끊김

To Reproduce
4.0.0 rc 2에서 태블릿으로 로그인 (#109)

Expected behavior
연결이 끊기지 않아야함.

Used Code

const { name, uuid, email, password, deviceType } = require("./account/account.json");
const { TalkClient, ServiceApiClient, AuthApiClient, xvc } = require("node-kakao");

let client = new TalkClient();

async function registerDevice(authClient) {
    let requestData = await authClient.requestPasscode({"email": email, "password": password, "forced": true});
    if (!requestData.success) {
        return {"success": false, "message": `RequestPasscode Failed! Data: ${JSON.stringify(requestData, null, 2)}`};
    } else {
        let readline = require("readline");
        let inputInterface = readline.createInterface({
            input: process.stdin,
            output: process.stdout,
        });

        let passcode = await new Promise((resolve) => inputInterface.question("Enter passcode: ", resolve));
        inputInterface.close();

        let registerData = await authClient.registerDevice({"email": email, "password": password, "forced": true}, passcode, true);
        if (!registerData.success) {
            return {"success": false, "message": `RegisterDevice Failed! Data: ${JSON.stringify(requestData, null, 2)}`};
        }

        return {"success": true};
    }
}

async function login() {
    let tabletConfig = {"agent": "android", "mccmnc": "999", "deviceModel": "SM-T976N", "appVersion": "9.2.1", "version": "9.2.1", "netType": 0, "subDevice": true};
    let authClient = await AuthApiClient.create(name, uuid);
    
    if (deviceType === "tablet") {
        authClient = await AuthApiClient.create(name, uuid, tabletConfig, xvc.AndroidSubXVCProvider);
        client = new TalkClient(tabletConfig);
    }

    let loginData = await authClient.login({"email": email, "password": password, "forced": true});

    if (!loginData.success) {
        if (loginData.status === KnownAuthStatusCode.DEVICE_NOT_REGISTERED) {
            let result = await registerDevice(authClient);
            if (!result.success) {
                console.log(result.message);
            } else {
                login();
            }
        } else {
            console.log(`Login Failed! Data: ${JSON.stringify(loginData, null, 2)}`);
        }
    } else {
        let loginRes = await client.login(loginData.result);
        if (!loginRes.success) {
            console.log(`Login Failed! loginResult: ${JSON.stringify(loginRes, null, 2)}`);
        } else {
            console.log(`Login Success!`);
        }
    }
}

login();
@nunnu1028 nunnu1028 added the bug Something isn't working label Feb 17, 2021
@storycraft storycraft added the dev Issue related to development branch label Feb 17, 2021
@nunnu1028
Copy link
Author

nunnu1028 commented Feb 17, 2021

이벤트 오류는 문법상 오류인것같아 일단 close

@nunnu1028 nunnu1028 changed the title 태블릿으로 로그인시 아무 이벤트도 없고 몇분뒤 연결이 끊김 태블릿으로 로그인시 몇분뒤 연결이 끊김 Feb 17, 2021
@nunnu1028
Copy link
Author

nunnu1028 commented Feb 17, 2021

끊기는건 맞는거 같아 재오픈

@nunnu1028 nunnu1028 reopened this Feb 17, 2021
@nunnu1028
Copy link
Author

추가정보

끊길때마다 연결되어있던 시간이 달라짐, PING을 보내는데 성공하더라도 끊기는 경우가 있음.

storycraft added a commit that referenced this issue Feb 17, 2021
Fix file sending.
Check media stream before closing stream.
Adjust ping interval using server background, foreground interval #149
@storycraft storycraft added documentation Improvements or additions to documentation and removed bug Something isn't working dev Issue related to development branch labels Feb 18, 2021
@storycraft
Copy link
Owner

ref #150

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

No branches or pull requests

2 participants