aws / aws-sdk-mobile-analytics-js

Amazon Mobile Analytics JavaScript SDK
Apache License 2.0
82 stars 38 forks source link

"new AWS.CognitoIdentityCredentials" resets IdentityId to null when there is no connection (offline) #12

Closed kest85 closed 8 years ago

kest85 commented 8 years ago

While connected to internet everything works fine. Problem appears when there is no connection.

AWS.config.credentials = new AWS.CognitoIdentityCredentials({
        IdentityPoolId: COGNITO_IDENTITY_POOL_ID
    });

This line of code resets identityId to null, so openOrCreateDataset is unable to open dataset. After that, when internet connection is available again, new identityId is assigned, so openOrCreateDataset creates new dataset instead of opening existing dataset, which was created with old identityId.

Is this a bug? if so, it looks like a critical one - whole offline functionality becomes unusable, because it is not possible to open existing dataset without having identityId (also when online new identityId makes old dataset not accessible).

Could anyone help me solve this problem?

kest85 commented 8 years ago

Sorry, mixed up git repositories. This is Cognito issue, not analytics. Created issue there: https://github.com/aws/amazon-cognito-js/issues/17