diff options
author | Simon Knox <psimyn@gmail.com> | 2017-07-18 04:35:43 +0300 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-07-18 05:17:55 +0300 |
commit | 53e7bf047084876cf441c010f683119fc54dfb6a (patch) | |
tree | 70003b202939b301e0647bbc24038125e790272f /app/assets/javascripts/lib | |
parent | 00861676a0cac3154153ec1afd7582991628e16e (diff) |
fix transient rspec failure due to Poll.js race condition
don't treat aborted requests as failures, they are often triggered during unload (e.g after clicking a link)
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/utils/http_status.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/lib/utils/poll.js | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/http_status.js b/app/assets/javascripts/lib/utils/http_status.js index 415e50f32ae..625e53ee9de 100644 --- a/app/assets/javascripts/lib/utils/http_status.js +++ b/app/assets/javascripts/lib/utils/http_status.js @@ -3,6 +3,7 @@ */ export default { + ABORTED: 0, NO_CONTENT: 204, OK: 200, }; diff --git a/app/assets/javascripts/lib/utils/poll.js b/app/assets/javascripts/lib/utils/poll.js index e31cc5fbabe..97666e13ebe 100644 --- a/app/assets/javascripts/lib/utils/poll.js +++ b/app/assets/javascripts/lib/utils/poll.js @@ -81,6 +81,9 @@ export default class Poll { }) .catch((error) => { notificationCallback(false); + if (error.status === httpStatusCodes.ABORTED) { + return; + } errorCallback(error); }); } |