From daacca2c3dadd97fec0a280c5334067b5e507920 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Tue, 13 Jan 2026 13:44:57 +0100 Subject: [PATCH] fix(crowdsec-wizard): Handle XHR abort in bouncer and services steps Service restarts during bouncer registration and service start can cause XHR connections to abort. Treat these as success since the operation likely completed. Co-Authored-By: Claude Opus 4.5 --- package/secubox/luci-app-crowdsec-dashboard/Makefile | 2 +- .../resources/view/crowdsec-dashboard/wizard.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package/secubox/luci-app-crowdsec-dashboard/Makefile b/package/secubox/luci-app-crowdsec-dashboard/Makefile index 2212ee97..812e4289 100644 --- a/package/secubox/luci-app-crowdsec-dashboard/Makefile +++ b/package/secubox/luci-app-crowdsec-dashboard/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-crowdsec-dashboard PKG_VERSION:=0.7.0 -PKG_RELEASE:=22 +PKG_RELEASE:=23 PKG_ARCH:=all PKG_LICENSE:=Apache-2.0 diff --git a/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js b/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js index b74ae2b1..7823a4db 100644 --- a/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js +++ b/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js @@ -728,6 +728,12 @@ return view.extend({ ]).then(function() { return { success: true }; }); + }).catch(function(err) { + // XHR abort during service restart is OK + if (err.message && err.message.indexOf('abort') !== -1) { + return { success: true }; + } + throw err; }); case 'services': @@ -738,6 +744,12 @@ return view.extend({ return new Promise(function(resolve) { setTimeout(resolve, 2000); }); }).then(function() { return { success: true }; + }).catch(function(err) { + // XHR abort during service restart is OK + if (err.message && err.message.indexOf('abort') !== -1) { + return { success: true }; + } + throw err; }); default: