Fix auto-refresh and queue claiming

This commit is contained in:
gpt-engineer-app[bot]
2025-10-06 19:01:49 +00:00
parent e1e8fa2ddc
commit cc3ec7a6e4
2 changed files with 37 additions and 12 deletions

View File

@@ -130,13 +130,22 @@ function hasItemChanged<T>(
compareFields?: (keyof T)[]
): boolean {
if (!compareFields || compareFields.length === 0) {
// Deep comparison if no specific fields provided
return JSON.stringify(currentItem) !== JSON.stringify(newItem);
// If no fields specified, assume no change (too sensitive to compare everything)
// This prevents false positives from object reference changes
return false;
}
// Compare only specified fields
for (const field of compareFields) {
if (currentItem[field] !== newItem[field]) {
const currentValue = currentItem[field];
const newValue = newItem[field];
// Handle nested objects/arrays
if (typeof currentValue === 'object' && typeof newValue === 'object') {
if (JSON.stringify(currentValue) !== JSON.stringify(newValue)) {
return true;
}
} else if (currentValue !== newValue) {
return true;
}
}