bulltrackers-module 1.0.516 → 1.0.517

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.
@@ -228,22 +228,23 @@ async function handleRequest(message, context, configObj, dependencies) {
228
228
  await handleUpdate(data, 'single-update', dependencies, config);
229
229
  break;
230
230
  case 'POPULAR_INVESTOR_UPDATE':
231
- // For POPULAR_INVESTOR_UPDATE, the entire payload IS the task data
232
- // (not wrapped in a 'data' field like other task types)
233
- // Extract task data from payload, excluding 'type'
234
- const taskData = data || {
235
- cid: payload.cid,
236
- username: payload.username,
237
- requestId: payload.requestId,
238
- source: payload.source,
239
- requestedBy: payload.requestedBy,
240
- actualRequestedBy: payload.actualRequestedBy,
241
- metadata: payload.metadata,
242
- priority: payload.priority
231
+ // For POPULAR_INVESTOR_UPDATE, fields are at the payload root level
232
+ // Merge data object with payload root fields
233
+ const taskData = {
234
+ cid: payload.cid || data?.cid,
235
+ username: payload.username || data?.username,
236
+ requestId: payload.requestId || data?.requestId,
237
+ source: payload.source || data?.source,
238
+ requestedBy: payload.requestedBy || data?.requestedBy,
239
+ effectiveRequestedBy: payload.effectiveRequestedBy || data?.effectiveRequestedBy,
240
+ metadata: payload.metadata || data?.metadata || {},
241
+ priority: payload.priority || data?.priority,
242
+ // Merge nested data object if it exists
243
+ ...(data || {})
243
244
  };
244
245
 
245
- if (!taskData || (!taskData.cid && !taskData.username)) {
246
- logger.log('ERROR', '[TaskEngine] POPULAR_INVESTOR_UPDATE missing required fields (cid or username)', { payload, taskData });
246
+ if (!taskData.cid && !taskData.username) {
247
+ logger.log('ERROR', '[TaskEngine] POPULAR_INVESTOR_UPDATE missing required fields (cid or username)', { payload, data, taskData });
247
248
  return;
248
249
  }
249
250
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.516",
3
+ "version": "1.0.517",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [