From c5f0387045bc9cdf800f5f934af60c6f157be931 Mon Sep 17 00:00:00 2001 From: jamesread Date: Sun, 19 Jul 2026 00:03:12 +0100 Subject: [PATCH] chore: coderabbit suggestions --- .pre-commit-config.yaml | 8 ++-- frontend/package-lock.json | 2 +- frontend/package.json | 2 +- frontend/resources/vue/ActionButton.vue | 24 ++++++++++- frontend/resources/vue/Dashboard.vue | 28 +++++++++--- frontend/resources/vue/ExecutionButton.vue | 10 +++-- frontend/resources/vue/views/ArgumentForm.vue | 2 + .../resources/vue/views/DiagnosticsView.vue | 15 +++++-- frontend/resources/vue/views/LoginView.vue | 43 +++++++++++++++++-- service/.golangci.yml | 14 +++--- service/Makefile | 4 +- .../auth/otoauth2/restapi_auth_oauth2.go | 4 +- .../config/config_reloader_user_test.go | 25 +++++------ .../internal/filehelper/file_change_notify.go | 6 ++- service/internal/filehelper/file_write.go | 7 ++- .../internal/installationinfo/runtimeinfo.go | 12 +++++- service/scripts/find-flakey-tests-inf/main.go | 9 ++-- 17 files changed, 161 insertions(+), 54 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db0bff1..8e38c30 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,28 +38,28 @@ repos: entry: make service-codestyle language: system pass_filenames: false - files: ^(service/|proto/|lang/) + files: ^(service/|proto/|lang/|Makefile) - id: frontend-codestyle name: frontend-codestyle entry: make frontend-codestyle language: system pass_filenames: false - files: ^frontend/ + files: ^(frontend/|Makefile) - id: service-unittests name: service-unittests entry: make service-unittests language: system pass_filenames: false - files: ^(service/|proto/|lang/) + files: ^(service/|proto/|lang/|Makefile) - id: service-build name: service-build entry: make service language: system pass_filenames: false - files: ^(service/|proto/|lang/) + files: ^(service/|proto/|lang/|Makefile) - id: it name: integration-tests diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 96ded27..4916cf4 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -33,7 +33,7 @@ "stylelint-config-standard": "^40.0.0" }, "engines": { - "node": ">=22.0.0" + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/@babel/code-frame": { diff --git a/frontend/package.json b/frontend/package.json index 13ebbbb..e812077 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -41,6 +41,6 @@ "vue-router": "^5.1.0" }, "engines": { - "node": ">=22.0.0" + "node": "^20.19.0 || >=22.12.0" } } diff --git a/frontend/resources/vue/ActionButton.vue b/frontend/resources/vue/ActionButton.vue index 28b4c16..436556d 100644 --- a/frontend/resources/vue/ActionButton.vue +++ b/frontend/resources/vue/ActionButton.vue @@ -247,10 +247,16 @@ function updateFromJson (json) { if (json.datetimeRateLimitExpires) { const date = new Date(json.datetimeRateLimitExpires.replace(' ', 'T')) rateLimitExpires.value = date.getTime() / 1000 + if (bindingId.value) { + rateLimits[bindingId.value] = rateLimitExpires.value + } updateRateLimitStatus() } else if (json.datetimeRateLimitExpires === '') { // Explicitly clear if empty string rateLimitExpires.value = 0 + if (bindingId.value) { + rateLimits[bindingId.value] = 0 + } updateRateLimitStatus() } } @@ -359,6 +365,15 @@ async function pollExecutionUntilDone (trackingId) { } } +let stopButtonResultWatch = null + +function stopWatchingButtonResult () { + if (stopButtonResultWatch) { + stopButtonResultWatch() + stopButtonResultWatch = null + } +} + async function startAction (actionArgs) { buttonClasses.value = [] // Removes old animation classes @@ -376,7 +391,8 @@ async function startAction (actionArgs) { console.log('Watching buttonResults for', startActionArgs.uniqueTrackingId) - watch( + stopWatchingButtonResult() + stopButtonResultWatch = watch( () => buttonResults[startActionArgs.uniqueTrackingId], (newResult, oldResult) => { onLogEntryChanged(newResult) @@ -397,12 +413,18 @@ async function startAction (actionArgs) { await pollExecutionUntilDone(trackingId) } } catch (err) { + stopWatchingButtonResult() console.error('Failed to start action:', err) } } function onLogEntryChanged (logEntry) { + if (!logEntry) { + return + } + if (logEntry.executionFinished) { + stopWatchingButtonResult() onExecutionFinished(logEntry) } else if (logEntry.queued && !logEntry.executionStarted) { onExecutionQueued(logEntry) diff --git a/frontend/resources/vue/Dashboard.vue b/frontend/resources/vue/Dashboard.vue index 2ec8bc0..8f427cc 100644 --- a/frontend/resources/vue/Dashboard.vue +++ b/frontend/resources/vue/Dashboard.vue @@ -1,6 +1,6 @@