Giter Site home page Giter Site logo

Error about skype-http HOT 5 CLOSED

ocilo avatar ocilo commented on May 27, 2024
Error

from skype-http.

Comments (5)

demurgos avatar demurgos commented on May 27, 2024

Thank you for your report.
I wasn't able to reproduce the issue (so at least it's not a global problem).

Could you tell me more about how the error happened? Are you using authentication with simple credentials (skype login and password)? Is it a temporary error? Is it a new error (were you able to connect to Skype before)?

from skype-http.

Sorunome avatar Sorunome commented on May 27, 2024

Since he is using https://github.com/matrix-hacks/matrix-puppet-skype I can answser a bit: (I am unable to reproduce his issue, too, and told him to make an issue here, since it appears to be within the skype-http library itself)

This is authenticating using username / password,

skypehttp.connect({
    credentials: {
        username: "blah",
        password: "blah"
    },
    verbose: true
})

https://github.com/matrix-hacks/matrix-puppet-skype/blob/master/client.js#L37

from skype-http.

demurgos avatar demurgos commented on May 27, 2024

Thank you.
I would have expected a 403 error to happen earlier during the login process. When the error happens, the user is already logged (as the logs show it) but is forbidden to register an endpoint for polling. Registration allows to later query new events.

I'd like you to try a few things.

Here is the JS version of subscribeToResources (in dist/lib-est2015/lib/login.js):

function subscribeToResources(ioOptions, registrationToken) {
    return __awaiter(this, void 0, void 0, function* () {
        // TODO(demurgos): typedef
        // tslint:disable-next-line:typedef
        const requestDocument = {
            interestedResources: [
                "/v1/threads/ALL",
                "/v1/users/ME/contacts/ALL",
                "/v1/users/ME/conversations/ALL/messages",
                "/v1/users/ME/conversations/ALL/properties",
            ],
            template: "raw",
            channelType: "httpLongPoll",
        };
        const requestOptions = {
            uri: messagesUri.subscriptions(registrationToken.host),
            cookies: ioOptions.cookies,
            body: JSON.stringify(requestDocument),
            headers: {
                RegistrationToken: registrationToken.raw,
            },
        };
        const res = yield ioOptions.io.post(requestOptions);
        if (res.statusCode !== 201) {
            return Promise.reject(new incident_1.Incident("net", `Unable to subscribe to resources: statusCode: ${res.statusCode} body: ${res.body}`));
        }
        // Example response:
        // {
        //   "statusCode": 201,
        //   "body": "{}",
        //   "headers": {
        //     "cache-control": "no-store, must-revalidate, no-cache",
        //       "pragma": "no-cache",
        //       "content-length": "2",
        //       "content-type": "application/json; charset=utf-8",
        //       "location": "https://db5-client-s.gateway.messenger.live.com/v1/users/ME/endpoints/SELF/subscriptions/0",
        //       "x-content-type-options": "nosniff",
        //       "contextid": "tcid=3434983151221922702,server=DB5SCH101121535",
        //       "date": "Sat, 14 May 2016 16:41:17 GMT",
        //       "connection": "close"
        //   }
        // }
    });
}
  1. Replace interestedResources by an empty array. If you get a 403 even with an empty array, we'll have to investigate further. If the request succeeds, try each resource individually to find the one which causes the error.

  2. Instead of emitting res.body in the error, please log the headers (JSON.stringify(res.headers)).

from skype-http.

Madji avatar Madji commented on May 27, 2024
function subscribeToResources(ioOptions, registrationToken) {
    return __awaiter(this, void 0, void 0, function* () {
        // TODO(demurgos): typedef
        // tslint:disable-next-line:typedef
        const requestDocument = {
            interestedResources: [
            //    "/v1/threads/ALL",
            //  "/v1/users/ME/contacts/ALL",
            //    "/v1/users/ME/conversations/ALL/messages",
            //    "/v1/users/ME/conversations/ALL/properties",
            ],
            template: "raw",
            channelType: "httpLongPoll",
        };
        const requestOptions = {
            uri: messagesUri.subscriptions(registrationToken.host),
            cookies: ioOptions.cookies,
            body: JSON.stringify(requestDocument),
            headers: {
                RegistrationToken: registrationToken.raw,
            },
        };

I hope I understand correctly. I did so. and got the same error as in the beginning

from skype-http.

demurgos avatar demurgos commented on May 27, 2024

Thank you, that's what I had in mind.
Since you still get a 403 error, it means that the issue was not with a particular resource but the whole registration process. I guess that the official web application works for you? (this library acts as an alternate client mimicking the web application). If it works, I'd need some logs to compare which HTTP requests the web app performs for you. I'll take some time this evening to test it myself and tell you what I need exactly.

from skype-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.