Merge branch 'feature/IO-3303-Socket-IO-Optimization-Auto-Add-Watchers-Gate' into release/2025-07-18

# Conflicts:
#	client/src/contexts/SocketIO/socketProvider.jsx
This commit is contained in:
Dave Richer
2025-07-14 18:45:34 -04:00
4 changed files with 181 additions and 96 deletions

View File

@@ -50,7 +50,12 @@ const autoAddWatchers = async (req) => {
try {
// Fetch bodyshop data from Redis
const bodyshopData = await getBodyshopFromRedis(shopId);
const notificationFollowers = bodyshopData?.notification_followers || [];
let notificationFollowers = bodyshopData?.notification_followers;
// Bail if notification_followers is missing or not an array
if (!notificationFollowers || !Array.isArray(notificationFollowers)) {
return;
}
// Execute queries in parallel
const [notificationData, existingWatchersData] = await Promise.all([