Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh tokens is broken #19

Closed
Rarst opened this issue Feb 3, 2015 · 5 comments · Fixed by #25
Closed

Refresh tokens is broken #19

Rarst opened this issue Feb 3, 2015 · 5 comments · Fixed by #25
Labels
Milestone

Comments

@Rarst
Copy link
Contributor

Rarst commented Feb 3, 2015

Yoast_Google_Analytics_Client->refresh_tokens() attempts to get response via $response = $this->refreshToken( $refresh_token );, which is void return method.

I am not confident in what should this be adjusted to?

Likely cause for recurrent HTTP requests, see awesomemotive/google-analytics-for-wordpress#261

@andizer
Copy link
Contributor

andizer commented Feb 20, 2015

I was diving into this piece and as far as I see, I did a wrong implementation of this. The method refreshToken will call refreshTokenRequest that already sets the accesstoken.

We should actually call method getAccessToken to store this temporary and validate this with isAccessTokenExpired.

@jdevalk
Copy link

jdevalk commented Jun 28, 2015

As @Rarst just showed me, this means we're doing a request to Google on every page load in the admin... We should fix this and release it ASAP.

@andizer
Copy link
Contributor

andizer commented Jun 28, 2015

@jdevalk I've fixed it for the GSC-client. I will fix this for the analytics client also. Probably I can take some of this into one file (like a yoast-api-client) for both clients.

@andizer andizer removed their assignment Jul 6, 2015
omarreiss added a commit that referenced this issue Jul 7, 2015
Fix continuously obtaining of the refresh tokens
@GaryJones
Copy link

As @Rarst just showed me, this means we're doing a request to Google on every page load in the admin... We should fix this and release it ASAP.

screenshot 2015-07-09 21 10 56

Yup, every. single. page. And I've just had it delay loading a page by 7.9 seconds 👎

@jdevalk
Copy link

jdevalk commented Jul 9, 2015

We know. But I want to make sure it's 100% tested before we release it.
We've done worse than this in a previous update, unfortunately.
On Thu 9 Jul 2015 at 22:14 Gary Jones notifications@github.com wrote:

As @Rarst https://github.com/rarst just showed me, this means we're
doing a request to Google on every page load in the admin... We should fix
this and release it ASAP.

[image: screenshot 2015-07-09 21 10 56]
https://cloud.githubusercontent.com/assets/88371/8605784/795fd9b6-267f-11e5-83cd-0dab05d3883c.png

Yup, every. single. page.


Reply to this email directly or view it on GitHub
#19 (comment).

@omarreiss omarreiss added this to the 2.0 milestone Jul 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants