Fix duplicated storage mounts in the settings view during oAuth2 flow#29145
Conversation
|
As a side note, the "grant access" button will be disabled to prevent further clicks |
| ) { | ||
| $('.configuration').trigger('oauth_step2', [{ | ||
| $tr.find('.configuration').trigger('oauth_step2', [{ | ||
| backend_id: $tr.attr('class'), |
There was a problem hiding this comment.
Oh okay so you are finding the configuration box closest to the current row to prevent any conflicts right?
There was a problem hiding this comment.
Only one row should trigger the step, no more. Finding the configuration box from the row seems the easiest and most understandable approach.
Btw, I'm not sure why the configuration box is triggering events when it's more natural that a button triggers them, but anyway this is focused on fixing the issue not changing anything.
There was a problem hiding this comment.
Button can trigger step 1 but not step 2 which is fired after OAuth completion
There was a problem hiding this comment.
Button can trigger step 1 but not step 2 which is fired after OAuth completion
Any reason for that? It's technically possible. Whether it's a good or bad idea, that's another topic to discuss.
There was a problem hiding this comment.
This is how it was built
Originally instead of firing events it was authenticating only Google Drive as part of OAuth2 and there was no way for other apps to know when OAuth was completed so instead I triggered oauth2 events which respective apps could listen
There was a problem hiding this comment.
@jvillafanez I think this would let an app's code decide whether they use a button or anything else for triggering the oauth flow.
|
@jvillafanez please backport to stable10 |
|
Backport to stable10: #29254 |
|
After this fix, i've seen duplicated WND mounts when configuring it. Maybe a race condition... will look at it a bit more, due to it happens once in a blue moon. |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Fix duplicated mount that could happen during oAuth2 flow. This has been partially tested with google drive but should fix other oAuth2 storages. Note that oAuth1 storages will likely present the same problem, which isn't fixed by this PR.
Related Issue
#28479
Motivation and Context
Duplicated mounts shouldn't be saved
How Has This Been Tested?
Manual testing
Screenshots (if appropriate):
Types of changes
Checklist: