[cherrypick - 610] add support for configurable entities limit for the connections browser - #1421
[cherrypick - 610] add support for configurable entities limit for the connections browser#1421GnsP wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request makes the Wrangler connection browsing entity limit configurable, replacing the hardcoded limit of 1000 with a default of 2000. Feedback points out that a negative configuration value could bypass the fallback logic and suggests ensuring the parsed limit is a positive integer.
| hstsPreload: cdapConfig['hsts.preload'], | ||
| runRecordsTtl: cdapConfig['app.run.records.ttl.days'], | ||
| defaultPollIntervalMs: parseInt(cdapConfig['ui.default.poll.interval.millis'], 10) || 10000, | ||
| defaultWranglerBrowseEntitiesLimit: parseInt(cdapConfig['ui.wrangler.connections.browse.entities.limit'], 10) || 2000, |
There was a problem hiding this comment.
If the configuration ui.wrangler.connections.browse.entities.limit is set to a negative number (e.g., "-100"), parseInt will return -100. Since -100 is truthy in JavaScript, the expression parseInt(...) || 2000 will evaluate to -100, which is an invalid limit and could cause the backend API to fail.
We should ensure the parsed limit is a positive integer, falling back to 2000 if it is less than or equal to 0 or invalid.
| defaultWranglerBrowseEntitiesLimit: parseInt(cdapConfig['ui.wrangler.connections.browse.entities.limit'], 10) || 2000, | |
| defaultWranglerBrowseEntitiesLimit: Math.max(parseInt(cdapConfig['ui.wrangler.connections.browse.entities.limit'], 10) || 0, 0) || 2000, |
cherrypick of #1403
Description
Summary of changes
PR Type
Links
Jira: Jira issue #
Test Plan
Screenshots