ashishkranjan / dabr

Automatically exported from code.google.com/p/dabr
0 stars 0 forks source link

no utc_offset in user object results in repeated calls to twitter_user_info() #123

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What are the steps to trigger the problem?
1) login with a user with no utc_offset in their user record (which I
believe corresponds to not having a timezone set)

2) open a few pages with timelines (home, user, search, favorites, etc)

What happened?

Home timeline takes forever to come up and after a few clicks on pages with
a timeline, results in a rate-limit error.

It looks like the twitter_date function in common/twitter.php looks to see
if the utc_offset is stored in a cookie and if not attempts to retrieve the
user record for the currently logged user then set the utc_offset to a
cookie. But since it doesn't exist, nothing is stored and this retrieve is
tried everytime twitter_date is called - which includes at least once for
every tweet in the timeline. 

What did you expect to happen?

the cookie to be saved, and only one call made to twitter_user_info()

I'm not sure if this is a common error (probably not?) but I got around it
by checking for a null utc_offset in twitter_date() and setting it to 0 if
it is null.

Original issue reported on code.google.com by ldoug...@gmail.com on 10 Mar 2010 at 6:14

GoogleCodeExporter commented 9 years ago

Original comment by david.carrington on 13 Jul 2010 at 7:11

GoogleCodeExporter commented 9 years ago

Original comment by david.carrington on 14 Jul 2010 at 7:23

GoogleCodeExporter commented 9 years ago
twitter_date() uses a static variable to prevent this from happening, limiting 
this to a maximum of one extra API call per page (tested). I'm dropping the 
priority on the issue accordingly, although I'll still look into this issue :)

Original comment by david.carrington on 14 Jul 2010 at 7:48