aiden-shared-calculations-unified 1.0.61 → 1.0.62

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.
@@ -98,10 +98,16 @@ class UserProfitabilityTracker {
98
98
 
99
99
  // --- Now, update the sharded history ---
100
100
  const shardIndex = parseInt(userId, 10) % NUM_SHARDS;
101
- const userHistory = existingData[shardIndex][userId] || [];
101
+
102
+ // --- START FIX for userHistory.push error ---
103
+ // The existing data is an object like { history: [...] }, not the array itself.
104
+ const userHistory = (existingData[shardIndex][userId] && existingData[shardIndex][userId].history)
105
+ ? existingData[shardIndex][userId].history
106
+ : [];
107
+ // --- END FIX ---
102
108
 
103
109
  // Store the decimal % pnl in the history
104
- userHistory.push({ date: today, pnl: dailyAvgPnl });
110
+ userHistory.push({ date: today, pnl: dailyAvgPnl });
105
111
 
106
112
  const shardKey = `user_profitability_shard_${shardIndex}`;
107
113
  if (!results[shardKey]) results[shardKey] = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiden-shared-calculations-unified",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "description": "Shared calculation modules for the BullTrackers Computation System.",
5
5
  "main": "index.js",
6
6
  "files": [