bulltrackers-module 1.0.148 → 1.0.149

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,15 +56,18 @@ async function handleUpdate(task, taskId, { logger, headerManager, proxyManager,
56
56
 
57
57
  let wasHistorySuccess = false, isPrivate = false;
58
58
 
59
+ // --- FIX: 'fetchHistory' MUST be declared here, outside the 'try' block ---
60
+ let fetchHistory = false;
61
+
59
62
  try {
60
63
  // Fetch history ONCE per user
61
64
  const promisesToRun = [];
62
- let fetchHistory = false;
65
+ // --- 'fetchHistory' is no longer declared here ---
63
66
 
64
67
  if (!historyFetchedForUser.has(userId)) {
65
68
  historyHeader = await headerManager.selectHeader();
66
69
  if (historyHeader) {
67
- fetchHistory = true;
70
+ fetchHistory = true; // This now sets the outer variable
68
71
  historyFetchedForUser.add(userId);
69
72
  const historyUrl = `${config.ETORO_API_USERSTATS_URL}${username}/trades/oneYearAgo?CopyAsAsset=true`;
70
73
  promisesToRun.push(proxyManager.fetch(historyUrl, { headers: historyHeader.header }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.148",
3
+ "version": "1.0.149",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [