Wp-calypso: Invites: investigate slow accept action

Created on 9 May 2016  路  9Comments  路  Source: Automattic/wp-calypso

In #5272, @alisterscott reported that in his testing, the accept action once took over 20 seconds to complete. 馃槺

I'm creating a separate issue to track this because I believe it is unrelated to our changes in #5272.

Here's some debug that @alisterscott provided:

Download the React DevTools for a better development experience: https://fb.me/react-devtools
[HMR] Waiting for update signal from WDS...
[WDS] Hot Module Replacement enabled.
calypso:invite-accept:controller invite_accepted is set in localStorage +0ms
calypso:invite-accept:controller Setting email_verified in user object +3ms
Uncaught TypeError: Cannot read property 'type' of undefined
Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `NoticesList`. See https://fb.me/react-warning-keys for more information.
calypso:invite-accept:controller Accepted invite and redirecting to:  / +23s
People Management [Type] Bug

All 9 comments

I believe this was happening to our e2e tests before #5272 so I wouldn't be worried about it being recently introduced. It may be related to how that extra screen came up previously as we didn't have the debug logs.

I just saw one take 49 seconds running on WordPress.com!

In this case these fail our e2e tests on Circle. I've added this logging to these builds also so we can access it for every run.

calypso:invite-accept:controller invite_accepted is set in localStorage +0ms
calypso:invite-accept:controller Setting email_verified in user object +2ms
Uncaught TypeError: Cannot read property 'type' of undefined
calypso:invite-accept:controller Accepted invite and redirecting to:  / +49s

FWIW I have only seen the slowness on followers and private viewers

I tested with these steps:

  1. I sent an invitation to an email address (not yet linked to a WP.com account) to become a Viewer on a private site
  2. I received the invitation email as expected
  3. I clicked "Accept Invitation" in the invitation email (opened in an incognito window)
  4. The window that opened invited me to sign up with that email address
  5. I filled out the signup form, hit "Sign Up and View" and was notified that I was added as a Viewer on the site.

I didn't experience any delay in this process.

My vague guess, after hitting this in some testing, was that it was related to forcing a reload of my full sites list (which is really long on the account I was using), and that taking a long time to return from the API. I don't actually have anything to back that up, it's just a hunch :)

@alisterscott How many sites does our test user have in the e2e tests?

@ebinnion: we set up a new user account for each invite acceptance (to the same shared site) so they will only have one site when they are accepting the invite

Bug scrub notes: this still needs further investigation.

This is a key part:

I have only seen the slowness on followers and private viewers

@alisterscott Should we remove the delays in the tests, and see if it's still happening?

I could no longer reproduce locally, so I've reduced to max wait for the e2e tests to accept the invite in this PR and we can see how it goes

Was this page helpful?
0 / 5 - 0 ratings