Skip to content

There is a bug in main: self.loggedIn : 113 - leading to Cannot read property 'reminders' of undefined #83

Open
@paulroth3d

Description

@paulroth3d

TLDR; @MauriceConrad - can you please release a new version - as there is a bug on main.js:113 that is fixed in the repo - BUT NOT if anyone npm installs..


There is a bug in main.js:113

it seems it is FIXED in the repository, BUT NOT IN npm.

This is what you get on line 113 if you install apple-icloud

npm install --save apple-icloud

look at node_modules/apple-icloud/main.js, and you get this:

      self.loggedIn = (function() {
        //console.log(self.auth.cookies.length > 0, !!self.auth.token, self.account != {}, self.username === username);
        return (self.auth.cookies.length > 0 && self.auth.token && self.account != {} && username ? (self.username === username) : true);
      })();

note the final condition: && username ? (self.username === username) : true

this is wrong and needs to be: && (username ? (self.username === username) : false));

(missing the parentheses around the check - bypassing the && operator, and almost always returning true)

This appears fixed in the git repository

https://github.com/MauriceConrad/iCloud-API/blob/master/main.js#L115


This is actually the source of a NUMBER of issues:

#64
#71
#53
#47

and many others.

These - and many others - all come from myCloud.account being an empty object, and therefore none of the apis can be called.

The reason it is empty is because self.loggedIn is setting to true, and therefore the self.login on line 162 never fires.

Could you please release a new version to npm?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions