Skip to content

Commit 9a2ca9b

Browse files
leomp12claude
andcommitted
fix(firebase): Only update nonOrdersTimestamp during non-orders processing runs
- Use conditional update logic to preserve nonOrdersTimestamp during orders-only runs - Implement merge strategy to selectively update Firestore document fields - Ensure nonOrdersTimestamp accurately reflects last non-order event processing time 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent fe19d5a commit 9a2ca9b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/firebase/src/handlers/check-store-events.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,14 @@ export default async () => {
293293
})),
294294
});
295295
}));
296-
return documentRef.set({
296+
const documentMergeData: Record<string, any> = {
297297
timestamp: maxTimestamp,
298-
nonOrdersTimestamp: isOrdersOnly ? lastNonOrdersTimestamp : maxTimestamp,
299298
pushedTimestamps: lastPushedTimestamps,
300299
activeApps,
301300
listenedEvents,
302-
});
301+
};
302+
if (!isOrdersOnly) {
303+
documentMergeData.nonOrdersTimestamp = maxTimestamp;
304+
}
305+
return documentRef.set(documentMergeData, { merge: true });
303306
};

0 commit comments

Comments
 (0)