Fix acknowledging some system job returning error. (#24860)

* use jobId to remove acknowledged job

* fix lint

* add changelog

* Update SystemJobsStore.js

---------

Co-authored-by: Mohamed OULD HOCINE <106236152+gally47@users.noreply.github.com>
This commit is contained in:
Ousmane SAMBA
2026-01-29 16:56:11 +01:00
committed by GitHub
parent 2913b72e37
commit 56e8a1521a
2 changed files with 9 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
type = "fixed"
message = "Fix App Owner: Acknowledging a restored archive job shows error."
issues = ["Graylog2/graylog-plugin-enterprise#10888"]
pulls = ["24860"]

View File

@@ -61,7 +61,8 @@ export const SystemJobsStore = singletonStore('core.SystemJobs', () =>
},
() => {
// If we get an error (probably 404 because the job is gone), remove the job from the cache and trigger an update.
const { [jobId]: currentJob, ...rest } = this.jobsById;
// eslint-disable-next-line no-unused-vars
const { [jobId]: _, ...rest } = this.jobsById;
this.jobsById = rest;
this.trigger({ jobsById: this.jobsById });
@@ -72,8 +73,8 @@ export const SystemJobsStore = singletonStore('core.SystemJobs', () =>
},
acknowledgeJob(jobId) {
const url = URLUtils.qualifyUrl(ApiRoutes.SystemJobsApiController.acknowledgeJob(jobId).url);
const promise = fetch('DELETE', url).then((response) => {
delete this.jobsById[response.id];
const promise = fetch('DELETE', url).then(() => {
delete this.jobsById[jobId];
});
SystemJobsActions.acknowledgeJob.promise(promise);