-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Enhance error handling in ComputeTablePropertyControlV2 binding methods #38205
base: release
Are you sure you want to change the base?
Conversation
…methods Updated the binding methods in `ComputeTablePropertyControlV2` to improve error handling. The binding prefix now includes a try-catch block to prevent runtime errors when processing table data, ensuring that null values are returned gracefully in case of exceptions.
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe pull request addresses a bug related to JSON values being displayed in table cells when certain rows lack corresponding values. The changes involve modifying error handling in the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/12368869711. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/src/components/propertyControls/TableComputeValue.tsx (1)
106-106
: Consider logging errors before returning nullWhile returning null is a good fallback, silently swallowing errors might make debugging harder.
Consider adding error logging:
- static bindingSuffix = `); } catch (e) { return null; }})}}`; + static bindingSuffix = `); } catch (e) { console.error('Table computation error:', e); return null; }})}}`;
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/src/components/propertyControls/TableComputeValue.tsx
(1 hunks)app/client/src/widgets/TableWidgetV2/widget/reactTableUtils/transformDataPureFn.tsx
(1 hunks)
🔇 Additional comments (3)
app/client/src/widgets/TableWidgetV2/widget/reactTableUtils/transformDataPureFn.tsx (1)
19-19
: Good type safety improvement!
Changing from any
to unknown
enforces better type checking and reduces potential runtime errors.
app/client/src/components/propertyControls/TableComputeValue.tsx (2)
103-103
: Good addition of try block for error isolation
The try block ensures that errors in one row's computation don't affect other rows.
103-106
: Verify impact on existing error handling
The new error handling affects all computed values. Let's verify there are no duplicate error handlers or logging.
✅ Verification successful
Let me analyze the error handling patterns in the codebase to verify if there are any duplicate handlers or logging conflicts.
Error handling implementation is appropriate
The error handling in TableComputeValue.tsx
is correctly implemented and doesn't conflict with other error handlers. The catch block returns null
for computation errors, while other handlers in the table widget ecosystem handle specific scenarios (date parsing, local data reading, etc.) with appropriate logging.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for existing error handling in table computation code
rg -A 2 "catch \(e\)" --type ts
Length of output: 65866
Script:
#!/bin/bash
# Search for error handling in table computation and related files
rg -A 2 "catch \(e\)" --type ts app/client/src/components/propertyControls/TableComputeValue.tsx app/client/src/widgets/TableWidgetV2/widget/utilities.ts app/client/src/widgets/TableWidgetV2/widget/propertyUtils.ts app/client/src/widgets/TableWidgetV2/widget/reactTableUtils/transformDataPureFn.tsx
Length of output: 2546
Deploy-Preview-URL: https://ce-38205.dp.appsmith.com |
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/12373445425. |
Deploy-Preview-URL: https://ce-38205.dp.appsmith.com |
Description
Updated the binding methods in ComputeTablePropertyControlV2 to improve error handling. The binding prefix now includes a try-catch block to prevent runtime errors when processing table data, ensuring that null values are returned gracefully in case of exceptions.
Fixes #38157
or
Fixes
Issue URL
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.Table"
🔍 Cypress test results
Warning
Tests have not run on the HEAD 7bf1714 yet
Tue, 17 Dec 2024 12:55:04 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
Bug Fixes
Documentation