Skip to content

If one social account fails on sync the rest are not executed #4076

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

Closed
humitos opened this issue May 9, 2018 · 9 comments · Fixed by #5171
Closed

If one social account fails on sync the rest are not executed #4076

humitos opened this issue May 9, 2018 · 9 comments · Fixed by #5171
Assignees
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Needed: design decision A core team decision is required
Milestone

Comments

@humitos
Copy link
Member

humitos commented May 9, 2018

While working on #4070 I found that if the user has 3 accounts connected and the first one fails for any reason (revoked token, for example) the other two are not going to be executed.

In this case, the user has two options to workaround this:

  1. disconnect the account that it's failing
  2. solve the issue with that account

I think we need to solve this from RTD side. The sync is executed in a celery task by looping over the connect accounts from that user and we need the Exception raised by this sync since we are using the state and the info['error'] attribute to communicate this to the user in the Javascript polling.

To reproduce this,

  1. connect 2 social accounts to your RTD account and go to the web page of the first one (found in that loop) and revoke the RTD application
  2. click on the sync button when importing a project
@humitos humitos added the Improvement Minor improvement to code label May 9, 2018
@agjohnson agjohnson added this to the Admin UX milestone Sep 19, 2018
@agjohnson agjohnson added the Accepted Accepted issue on our roadmap label Sep 19, 2018
@luanfonceca
Copy link

Hey @agjohnson, i would like to fix this one during the Djangocon sprint. It's okay?

@stsewd
Copy link
Member

stsewd commented Oct 18, 2018

@luanfonceca go ahead!

@luanfonceca
Copy link

If i got it right, the issue is that this "Syncing" state is endless. Because we disconnected the account on the Social side. So it doesn't have access anymore, right?

kkoiaudcma

@humitos
Copy link
Member Author

humitos commented Oct 22, 2018

@luanfonceca yes, the loop is endless because the celery task the server executed crashed, so no proper result is returned to the front end and it keeps trying to get a response.

The solution would be to handle the proper exception risen in the server and continue the execution for the next social account.

@stsewd stsewd self-assigned this Jan 3, 2019
@stsewd
Copy link
Member

stsewd commented Jan 17, 2019

@humitos I have some code working for this, but I have a question. I'm returning all the errors like this

screenshot_2019-01-17 import a remote repository read the docs

I'm thinking in returning a list with all the errors instead of just one, but for that I need to modify the api from public_tasks. Should I go for that way? Or maybe just return the first error?

@stsewd
Copy link
Member

stsewd commented Jan 17, 2019

We only use public_task for syncing the repo and for reporting the build commands.

@stsewd stsewd added the Needed: design decision A core team decision is required label Jan 21, 2019
@humitos
Copy link
Member Author

humitos commented Jan 23, 2019

I'm thinking in returning a list with all the errors instead of just one, but for that I need to modify the api from public_tasks. Should I go for that way? Or maybe just return the first error?

Do you think it's better to go verbose here?

Isn't it enough (at least for now) to say: "Hey, there was an error with one of your social accounts: our access was revoked. Please, reconnect them to avoid this problem."

@stsewd
Copy link
Member

stsewd commented Jan 23, 2019

Isn't it enough (at least for now) to say: "Hey, there was an error with one of your social accounts: our access was revoked. Please, reconnect them to avoid this problem."

Currently we are showing the name of the failed account, making it generic would be a step back I think.

What about re-raising a different message? Something like Our access to your following accounts were revoked: GitHub, BitBucket...

@humitos
Copy link
Member Author

humitos commented Jan 23, 2019

That's way better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Needed: design decision A core team decision is required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants