From 915aaeeea0ac24c1912f28a024e1df11c76d31b2 Mon Sep 17 00:00:00 2001
From: Adhidarma Hadiwinoto <me@adhisimon.org>
Date: Tue, 6 Aug 2024 15:32:30 +0700
Subject: [PATCH] include request id di dump webhook

---
 lib/webhook-sender.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/webhook-sender.js b/lib/webhook-sender.js
index 8d9cda6..14704d6 100644
--- a/lib/webhook-sender.js
+++ b/lib/webhook-sender.js
@@ -37,8 +37,10 @@ const dumper = async (xid, webhookType, body) => {
         const filename = [
             [moment().format('YYYYMMDD-HHmmssSSS'), xid].join('_'),
             webhookType,
+            body.request_id,
             'json',
-        ].join('.');
+        ].filter((item) => item).join('.');
+
         await fs.promises.writeFile(
             path.join(baseDumpDir, filename),
             stringify({ webhookType, body }),
-- 
1.9.0