improvement(tables): make max row size env-configurable and raise default to 400KB#5338
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds Reviewed by Cursor Bugbot for commit a34c919. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryRaises the per-row size limit from 100 KB to 400 KB and makes it runtime-configurable via
Confidence Score: 4/5Safe to merge; the logic change is confined to a single validation function and follows the well-established env-override pattern already in use. The production code path is clean — getMaxRowSizeBytes() correctly defaults to the new 400 KB constant and safely gates on min:1, integer:true. The one concern is in the test: it sizes its oversized payload against the static constant rather than the runtime-resolved value, so the assertion could silently pass if TABLE_MAX_ROW_SIZE_BYTES were set to a larger value in the test environment. The test at apps/sim/lib/table/tests/validation.test.ts line 176 should drive off getMaxRowSizeBytes() rather than TABLE_LIMITS.MAX_ROW_SIZE_BYTES. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[validateRowSize called] --> B[getMaxRowSizeBytes]
B --> C{TABLE_MAX_ROW_SIZE_BYTES env var set?}
C -- Yes --> D[envNumber validates min=1, integer=true]
D --> E[Use env value]
C -- No --> F[Use TABLE_LIMITS.MAX_ROW_SIZE_BYTES 400 KB default]
E --> G[Compute JSON.stringify size]
F --> G
G --> H{size > maxRowSizeBytes?}
H -- Yes --> I[Return error with effective limit in message]
H -- No --> J[Return valid]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[validateRowSize called] --> B[getMaxRowSizeBytes]
B --> C{TABLE_MAX_ROW_SIZE_BYTES env var set?}
C -- Yes --> D[envNumber validates min=1, integer=true]
D --> E[Use env value]
C -- No --> F[Use TABLE_LIMITS.MAX_ROW_SIZE_BYTES 400 KB default]
E --> G[Compute JSON.stringify size]
F --> G
G --> H{size > maxRowSizeBytes?}
H -- Yes --> I[Return error with effective limit in message]
H -- No --> J[Return valid]
Reviews (1): Last reviewed commit: "improvement(tables): make max row size e..." | Re-trigger Greptile |
Summary
TABLE_MAX_ROW_SIZE_BYTESenv var (read at call time invalidateRowSize, same pattern as the plan-limit overrides)Type of Change
Testing
Table validation tests pass (54/54).
bun run lintandbun run check:api-validation:strictpass.Checklist