Skip to content

fix: WDS Phone Input reset on submit failure - #42206

Open
abhijeetnardele24-hash wants to merge 3 commits into
appsmithorg:releasefrom
abhijeetnardele24-hash:fix/issue-34054
Open

fix: WDS Phone Input reset on submit failure#42206
abhijeetnardele24-hash wants to merge 3 commits into
appsmithorg:releasefrom
abhijeetnardele24-hash:fix/issue-34054

Conversation

@abhijeetnardele24-hash

@abhijeetnardele24-hash abhijeetnardele24-hash commented Sep 8, 2026

Copy link
Copy Markdown

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 resetWidgetText method in WDSPhoneInputWidget.tsx was issuing two sequential, non-batched metadata updates (updateWidgetMetaProperty) for text (via the superclass) and rawText directly. This caused a race condition within Appsmith's Redux state management for widgets, resulting in the actual reset of the text field failing to correctly propagate to the UI.

Fix:
Refactored the resetWidgetText method to use the batch update API (pushBatchMetaUpdates and commitBatchMetaUpdates), correctly mirroring how the standard WDSInputWidget safely handles resetting multiple meta properties simultaneously. This guarantees that the values reset to "" atomically.

Fixes #34054

Summary by CodeRabbit

  • Bug Fixes
    • The OAuth expiration setting now appears only when the Authorization Code grant type is selected.
    • Resetting the phone input now reliably clears both displayed and underlying text values.
    • Messages sent to Anthropic without a specified content type are now correctly interpreted as text.

@abhijeetnardele24-hash
abhijeetnardele24-hash requested a review from a team as a code owner September 8, 2026 05:38
Copilot AI lite review requested due to automatic review settings September 8, 2026 05:38

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added awaiting-maintainer The next action on this pull request belongs to an Appsmith maintainer external-contribution Pull request submitted from outside the Appsmith repository labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

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 awaiting-maintainer label.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 41a27c1b-03fd-455c-bf4d-1cac6cba12b8

📥 Commits

Reviewing files that changed from the base of the PR and between 81da26b and 29bf556.

📒 Files selected for processing (3)
  • app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx
  • app/client/src/widgets/wds/WDSPhoneInputWidget/widget/index.tsx
  • app/server/appsmith-plugins/anthropicPlugin/src/main/java/com/external/plugins/commands/VisionCommand.java

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The changes conditionally render an OAuth expiration field, batch phone widget text resets, and treat blank Anthropic vision message types as text.

Changes

OAuth form rendering

Layer / File(s) Summary
Conditional OAuth expiration field
app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx
The expiration input now appears only for the Authorization Code grant type.

Phone widget reset

Layer / File(s) Summary
Batched phone text reset
app/client/src/widgets/wds/WDSPhoneInputWidget/widget/index.tsx
resetWidgetText clears rawText and text in one metadata batch.

Vision message defaults

Layer / File(s) Summary
Default vision message type
app/server/appsmith-plugins/anthropicPlugin/src/main/java/com/external/plugins/commands/VisionCommand.java
Missing or blank message types now default to TEXT.

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 29bf5

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: sebastianiv21

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The OAuth2 authorization-code change and the Anthropic VisionCommand change are unrelated to issue #34054 and the stated WDS Phone Input objective. Remove the unrelated OAuth2 and VisionCommand changes from this pull request, or link separate issues that explicitly require those changes and split them into separate pull requests.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: fixing the WDS Phone Input reset-on-submit failure.
Description check ✅ Passed The description explains the bug, root cause, fix, and linked issue. It does not include the template's Testing or Communication sections, but the core information is complete.
Linked Issues check ✅ Passed The WDS Phone Input change addresses issue #34054 by batching the reset of text and rawText, including the Enter-key submission scenario.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

⚠️ This pull request shows signs of AI-generated slop (description_diff_mismatch). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.


OAuth fields wait for the proper grant
Phone text clears in one swift chant
Blank vision types find their way
As text content through the day
Three small fixes keep flows bright

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-maintainer The next action on this pull request belongs to an Appsmith maintainer external-contribution Pull request submitted from outside the Appsmith repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Reset on submit does not work for phone input widget

2 participants