Duplicate requests made for pagination in environments_mixin.js
As seen in https://gitlab.com/gitlab-org/gitlab-ce/issues/58095 and fixed by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25506, there are more instances where a request is made, and then the same request is launched again.
@filipa I tried to fix this in this way, but it looks like the page never changes:
diff --git a/app/assets/javascripts/environments/mixins/environments_mixin.js b/app/assets/javascripts/environments/mixins/environments_mixin.js
index e81a1525df0..694447a0104 100644
--- a/app/assets/javascripts/environments/mixins/environments_mixin.js
+++ b/app/assets/javascripts/environments/mixins/environments_mixin.js
@@ -64,10 +64,9 @@ export default {
// fetch new data
return this.service
.fetchEnvironments(this.requestData)
- .then(response => this.successCallback(response))
- .then(() => {
- // restart polling
- this.poll.restart({ data: this.requestData });
+ .then(response => {
+ this.successCallback(response);
+ this.poll.enable({ data: this.requestData, response })
})
.catch(() => {
this.errorCallback();
Edited by Stan Hu