refactor(core): Upgrade axios to address AIKIDO-2025-10185 (#14890)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Iván Ovejero
2025-04-29 17:43:12 +02:00
committed by GitHub
parent 979f9e6327
commit 7e764ce55c
6 changed files with 102 additions and 119 deletions

View File

@@ -1,21 +0,0 @@
diff --git a/lib/job.js b/lib/job.js
index 6a3606974fd3e397c6c5b2b6e65b20670c68f753..4cdbed1d564ceeb5a80c92eb605e49cfd3c8ccdd 100644
--- a/lib/job.js
+++ b/lib/job.js
@@ -511,9 +511,14 @@ Job.prototype.finished = async function() {
}
};
- const onFailed = (jobId, failedReason) => {
+ const onFailed = async (jobId, failedReason) => {
if (String(jobId) === String(this.id)) {
- reject(new Error(failedReason));
+ const job = await Job.fromId(this.queue, this.id);
+ const error = new Error(failedReason);
+ if (job && job.stacktrace && job.stacktrace.length > 0) {
+ error.stack = job.stacktrace.join('\n');
+ }
+ reject(error);
removeListeners();
}
};

21
patches/bull@4.16.4.patch Normal file
View File

@@ -0,0 +1,21 @@
diff --git a/lib/job.js b/lib/job.js
index 1642d3fb35cbd64b553291660fc63bae2e7f2ef5..3301e3fbc7296f545b65331dad1f12c820267e0d 100644
--- a/lib/job.js
+++ b/lib/job.js
@@ -513,9 +513,14 @@ Job.prototype.finished = async function() {
}
};
- const onFailed = (jobId, failedReason) => {
+ const onFailed = async (jobId, failedReason) => {
if (String(jobId) === String(this.id)) {
- reject(new Error(failedReason));
+ const job = await Job.fromId(this.queue, this.id);
+ const error = new Error(failedReason);
+ if (job && job.stacktrace && job.stacktrace.length > 0) {
+ error.stack = job.stacktrace.join('\n');
+ }
+ reject(new Error(error));
removeListeners();
}
};