-
Notifications
You must be signed in to change notification settings - Fork 356
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
Set afterGet when the OPTIONS data is actually retrieved #827
Conversation
@miq-bot add_label fine/yes, bug |
/cc @mzazrivec @himdel @h-kataria Please review. Noticed the issue in yesterday's heavy-duty testing. |
Checked commit AparnaKarve@4f2ee61 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Set afterGet when the OPTIONS data is actually retrieved (cherry picked from commit 0b36dcb)
Fine backport details:
|
@AparnaKarve This breaks |
Not really, since that one deals with a different request entirely :) But thanks for that, that's exactly how I found this bug :). But.. since more info is probably needed, the bug is this:
OTOH if the The only way to make sure var select_promise = API.options('/api/authentications')
.then(getCredentialOptions)
.catch(miqService.handleFailure);
var data_promise;
if (credentialId !== 'new') {
data_promise = API.get('/api/authentications/' + credentialId)
.then(getCredentialFormData)
.catch(miqService.handleFailure);
} else {
data_promise = Promise.resolve();
// ...the rest of the else body...
}
$q.all([data_promise, select_promise])
.then(function() {
vm.afterGet = true;
}); (and remove the other two |
Ok, so either use What do you prefer? |
Definitely Thanks for looking into this! :) |
Alrighty, you got it! :) |
API
calls are async and thereforeafterGet
needs to be set once we have actually retrieved the data ingetCredentialOptions
from theAPI.options('/api/authentications')
call.Without this change, there is a chance that one could see an empty dropdown for a few brief seconds when the form is loaded as seen in the screenshot --