7

A few weeks ago we started noticing strange errors from the google client API or google drive JS api (not sure which, the URL reference is below), they have increased in frequency over the last few days

 TypeError: Cannot read property 'sl' of undefined

This seems to be affecting windows Chrome mostly - a typical example of the user agent from our error logs is

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31)

from what I could see, the only line with .sl is this:

if(!this.b.headers.Authorization){var f=(0,_.Hx)(_.p,_.p);f&&f[_.Ak.pl.sl]&&(c=f[_.Ak.pl.sl].split(/\w+/))}

this comes from

https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en.uSTvEdNXb7o.O/m=client/rt=j/sv=1/d=1/ed=1/am=UQ/rs=AItRSTOm1KS5pZVEepZkn9qQJeuQZC_Qjw/cb=gapi.loaded_0

I know this is intentionally cryptic, so it's beyond me to suggest how to fix it, but I would appreciate if someone looks into this as the frequency seems to be increasing. Perhaps a guard around _Ak.pl to check if it's not null before executing .sl ?

IvenMS
  • 525
  • 5
  • 19
Gojko Adzic
  • 1,241
  • 10
  • 9
  • I am also facing the same problem. Is there any solution available? This is something related to the SDK provided. I am only following the samples given in the documents. – IvenMS May 02 '13 at 05:38
  • we did some more investigation and the problem seems to be related to session timeout. a workaround is to check if the gapi auth token is empty and if so try to call auth again before calling any other function. – Gojko Adzic May 02 '13 at 11:19
  • Found the solution and the problem seems to be because of the authorize settings. The API seems to be not working with the settings "offline". – IvenMS May 04 '13 at 06:22

1 Answers1

2

I managed to resolve the problem which was reported. The issue is due to the authorize settings. Some settings seems to be not working for the app. Now the app works with following settings:

gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthResult);

Previously the app was configured to run offline.

Note: In the code, clientId and scopes are variables, handleAuthResult is an associated function.

IvenMS
  • 525
  • 5
  • 19