fix: WDS Phone Input reset on submit failure - #42206
fix: WDS Phone Input reset on submit failure#42206abhijeetnardele24-hash wants to merge 3 commits into
Conversation
|
Thanks for contributing to Appsmith! Credential-free formatting, lint, type, and unit checks will run after GitHub's workflow approval. An Appsmith maintainer will start privileged integration tests or a deploy preview when needed. No action is required from you while this PR has the |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe changes conditionally render an OAuth expiration field, batch phone widget text resets, and treat blank Anthropic vision message types as text. ChangesOAuth form rendering
Phone widget reset
Vision message defaults
Priority: ➖ Normal — Impact reflects medium issue severity. Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to This change makes phone reset-on-submit update visible and raw values together, limits OAuth expiration input to Authorization Code grants, and treats blank vision message types as text. No merge-blocking risk is identified. Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning OAuth fields wait for the proper grant Comment |
Description
This PR fixes a bug in the WDS Phone Input widget where the widget fails to reset its value upon submission when the "Reset on submit" property is enabled.
Root cause:
The
resetWidgetTextmethod inWDSPhoneInputWidget.tsxwas issuing two sequential, non-batched metadata updates (updateWidgetMetaProperty) fortext(via the superclass) andrawTextdirectly. This caused a race condition within Appsmith's Redux state management for widgets, resulting in the actual reset of thetextfield failing to correctly propagate to the UI.Fix:
Refactored the
resetWidgetTextmethod to use the batch update API (pushBatchMetaUpdatesandcommitBatchMetaUpdates), correctly mirroring how the standardWDSInputWidgetsafely handles resetting multiple meta properties simultaneously. This guarantees that the values reset to""atomically.Fixes #34054
Summary by CodeRabbit