bulltrackers-module 1.0.583 → 1.0.585
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.
|
@@ -207,9 +207,11 @@ async function handleGenericUserUpdate(taskData, config, dependencies, isPI) {
|
|
|
207
207
|
const requestOptions = { method: 'GET', headers: selectedHeader || {} };
|
|
208
208
|
|
|
209
209
|
// Update Request Status (if On-Demand)
|
|
210
|
+
// Use user_sync_requests for signed-in users (on_demand_sync or user_signup), pi_fetch_requests for PIs
|
|
210
211
|
if (requestId && db) {
|
|
211
212
|
try {
|
|
212
|
-
const
|
|
213
|
+
const isSignedInUser = source === 'on_demand_sync' || source === 'user_signup' || metadata?.userType === 'SIGNED_IN_USER';
|
|
214
|
+
const reqRef = db.collection(isSignedInUser ? 'user_sync_requests' : 'pi_fetch_requests')
|
|
213
215
|
.doc(String(cid)).collection('requests').doc(requestId);
|
|
214
216
|
await reqRef.update({ status: 'processing', startedAt: FieldValue.serverTimestamp() });
|
|
215
217
|
|
|
@@ -294,7 +296,8 @@ async function handleGenericUserUpdate(taskData, config, dependencies, isPI) {
|
|
|
294
296
|
|
|
295
297
|
// Mark Failed
|
|
296
298
|
if (requestId && db) {
|
|
297
|
-
const
|
|
299
|
+
const isSignedInUser = source === 'on_demand_sync' || source === 'user_signup' || metadata?.userType === 'SIGNED_IN_USER';
|
|
300
|
+
const reqRef = db.collection(isSignedInUser ? 'user_sync_requests' : 'pi_fetch_requests')
|
|
298
301
|
.doc(String(cid)).collection('requests').doc(requestId);
|
|
299
302
|
await reqRef.update({ status: 'failed', error: errorMessage, failedAt: FieldValue.serverTimestamp() });
|
|
300
303
|
|
|
@@ -331,7 +334,9 @@ async function finalizeOnDemandRequest(deps, config, taskData, isPI, success, to
|
|
|
331
334
|
const { cid, username, requestId, source, metadata } = taskData;
|
|
332
335
|
|
|
333
336
|
// 1. Run Root Data Indexer
|
|
334
|
-
|
|
337
|
+
// Use user_sync_requests for signed-in users (on_demand_sync or user_signup), pi_fetch_requests for PIs
|
|
338
|
+
const isSignedInUser = source === 'on_demand_sync' || source === 'user_signup' || metadata?.userType === 'SIGNED_IN_USER';
|
|
339
|
+
const reqRef = db.collection(isSignedInUser ? 'user_sync_requests' : 'pi_fetch_requests')
|
|
335
340
|
.doc(String(cid)).collection('requests').doc(requestId);
|
|
336
341
|
|
|
337
342
|
await reqRef.update({ status: 'indexing', rawDataStoredAt: FieldValue.serverTimestamp() });
|