bulltrackers-module 1.0.675 → 1.0.676

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.
@@ -2058,8 +2058,12 @@ const fetchTrendingPopularInvestors = async (db) => {
2058
2058
  const dateKey = checkDate.toISOString().split('T')[0];
2059
2059
  try {
2060
2060
  const result = await getComputationResults(db, 'TrendingPopularInvestors', dateKey);
2061
- if (result && result.trending) {
2062
- return Array.isArray(result.trending) ? result.trending : [];
2061
+ console.log(`[Trending] Got result for ${dateKey}:`, JSON.stringify(result).substring(0, 500));
2062
+ // If we got a result, return it (even if trending array is empty)
2063
+ if (result) {
2064
+ const trending = result.trending || [];
2065
+ console.log(`[Trending] Returning trending array with ${trending.length} items`);
2066
+ return trending;
2063
2067
  }
2064
2068
  } catch (e) {
2065
2069
  // Continue to next date
@@ -2068,6 +2072,7 @@ const fetchTrendingPopularInvestors = async (db) => {
2068
2072
  }
2069
2073
  }
2070
2074
  }
2075
+ console.log(`[Trending] No data found, returning empty array`);
2071
2076
  return [];
2072
2077
  };
2073
2078
 
@@ -2081,8 +2086,12 @@ const fetchPopularInvestorCategories = async (db) => {
2081
2086
  const dateKey = checkDate.toISOString().split('T')[0];
2082
2087
  try {
2083
2088
  const result = await getComputationResults(db, 'PopularInvestorCategories', dateKey);
2084
- if (result && result.categories) {
2085
- return typeof result.categories === 'object' ? result.categories : {};
2089
+ console.log(`[Categories] Got result for ${dateKey}:`, JSON.stringify(result).substring(0, 500));
2090
+ // If we got a result, return it (even if categories object is empty)
2091
+ if (result) {
2092
+ const categories = result.categories || {};
2093
+ console.log(`[Categories] Returning categories object with ${Object.keys(categories).length} keys`);
2094
+ return categories;
2086
2095
  }
2087
2096
  } catch (e) {
2088
2097
  // Continue to next date
@@ -2091,6 +2100,7 @@ const fetchPopularInvestorCategories = async (db) => {
2091
2100
  }
2092
2101
  }
2093
2102
  }
2103
+ console.log(`[Categories] No data found, returning empty object`);
2094
2104
  return {};
2095
2105
  };
2096
2106
 
@@ -224,10 +224,14 @@ router.get('/computations', async (req, res) => {
224
224
 
225
225
  try {
226
226
  const checkData = await getComputationResults(db, compName, dateKey, userId);
227
+ console.log(`[Recommended] Got result for ${dateKey}:`, JSON.stringify(checkData).substring(0, 500));
227
228
  if (checkData && typeof checkData === 'object' && checkData[userCidStr]) {
229
+ console.log(`[Recommended] Found user ${userCidStr} data in ${dateKey}`);
228
230
  data = checkData;
229
231
  foundData = true;
230
232
  break;
233
+ } else {
234
+ console.log(`[Recommended] User ${userCidStr} not found in ${dateKey}, available keys:`, checkData ? Object.keys(checkData).slice(0, 10) : 'no data');
231
235
  }
232
236
  } catch (e) {
233
237
  // Continue to next date
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.675",
3
+ "version": "1.0.676",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [