-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Do not call the callback if the selected auth method can't be retreived #28493
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of this deferred/promise ? usually the purpose of a promise is to be returned and resolved later within a callback. Also it seems to be unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gdrive uses the "onCompletition" callback, so unless we send something it will explode because the variable will be undefined. From my point of view, it was buggy from the beginning.
It's either use a dummy (the current solution) or try to remove these calls and force triggering an event at some point.
I've also tried to remove the callback. It seemed to work, so I don't know what was the reason to put that code in the first place.
I've already spent too much time just for this, so I've went for patching the bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hemant-Mann I believe this might be related to your recent changes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jvillafanez Are you referring to this onCompletion callback?
https://github.com/owncloud/core/blob/master/apps/files_external/js/oauth2.js#L17
@PVince81 I don't think this Issue is related to my recent changes.
Hey @jvillafanez could you please describe the issue in a little more detail
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jvillafanez I have gone through the whole flow of selecting GDrive (when creating a PR) and was able to successfully authenticate it using OAuth2 so I am not sure what's the error
See this screenshot here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delay the https://github.com/owncloud/core/blob/master/apps/files_external/js/oauth2.js#L7 call 5 seconds with a setTimeout, something like:
When you select a new mount gdrive mount, the button to grant access to the storage is missing.
This happens in the personal settings page, when several admin mount are presents for the user.
Note that this affects to other storages that are loaded before the files_external's settings js and are forced to use the "mountConfigLoaded" to register the auth mechanism. That delay intends to simulate that, as the call to that method will be done quite late.
As far as I know, the bug might have been there before @Hemant-Mann 's changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so if @Hemant-Mann has no strong objection let's just merge this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No Objection from my side. This should be good to go