Commit af66fefc authored by Fatih Acet's avatar Fatih Acet

Merge branch 'improve-vuejs-resource-interceptor' into 'master'

Reduce intermittent spec failures by making VueJS resource interceptor decrement outstanding resource counts when HTTP response is received

Before the count would be reduced 500 ms after a DOM update tick, which could cause race conditions since the `DatabaseCleaner` could run in the middle of a Rails controller handling the response.

Partial fix to #21197 and other intermittent spec failures.

See merge request !6224
parents aa152e4a 924141fb
Vue.http.interceptors.push((request, next) => { Vue.http.interceptors.push((request, next) => {
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1; Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
Vue.nextTick(() => { next(function (response) {
setTimeout(() => {
Vue.activeResources--; Vue.activeResources--;
}, 500);
}); });
next();
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment