Skip to content

feat(redis): improve pagination and filtering logic in getRowsFromTable method#1442

Merged
Artuomka merged 1 commit into
mainfrom
backend_redis_credentials
Nov 20, 2025
Merged

feat(redis): improve pagination and filtering logic in getRowsFromTable method#1442
Artuomka merged 1 commit into
mainfrom
backend_redis_credentials

Conversation

@Artuomka

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings November 20, 2025 14:39
@Artuomka Artuomka merged commit da12b88 into main Nov 20, 2025
14 checks passed
@Artuomka Artuomka deleted the backend_redis_credentials branch November 20, 2025 14:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the Redis data access layer by enhancing null-safety for settings handling, fixing a bug in search field resolution, and improving pipeline result handling. The main changes include introducing defensive checks for the settings parameter and correctly using the table name when fetching table structure for search operations.

Key changes:

  • Added safeSettings defensive wrapper to handle null/undefined settings
  • Fixed bug where row.key was incorrectly used instead of tableName when fetching table structure for search fields
  • Improved pipeline result handling to support both array and non-array response formats
Comments suppressed due to low confidence (1)

shared-code/src/data-access-layer/data-access-objects/data-access-object-redis.ts:691

  • This guard always evaluates to false.
              result = rowValue === null || rowValue === undefined || rowValue === '';

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
}
}
}

Copilot AI Nov 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of early exit logic means the code now always scans the entire Redis keyspace, even when only a small page of results is needed. This can significantly impact performance for large datasets.

Consider re-implementing early exit logic, but fix the original bug where the condition cursor === '0' prevented it from working correctly. A better approach would be to break when allRows.length >= (page * perPage) + perPage, which ensures we have enough rows to satisfy the current page request.

Suggested change
}
}
// Early exit: break if we have enough rows for the requested page
if (allRows.length >= (page * perPage) + perPage) {
break;
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants