Skip to content

fix: prevent onCheckChange from firing during programmatic updates#41786

Open
charliesheh wants to merge 1 commit intoappsmithorg:releasefrom
charliesheh:fix-checkbox-programmatic-change
Open

fix: prevent onCheckChange from firing during programmatic updates#41786
charliesheh wants to merge 1 commit intoappsmithorg:releasefrom
charliesheh:fix-checkbox-programmatic-change

Conversation

@charliesheh
Copy link
Copy Markdown

@charliesheh charliesheh commented May 8, 2026

Closes #41505
Removes the programmatic update handling block from CheckboxWidget that could cause onCheckChange behavior during non-user-triggered state updates.

The checkbox change event should only fire from direct user interaction through the checkbox component's onChange handler, not from programmatic property synchronization.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed unintended checkbox state synchronization that occurred when properties changed, preventing unexpected updates to the checkbox state in certain scenarios.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9b5b195b-ce17-4183-8aa0-b364b4830e0a

📥 Commits

Reviewing files that changed from the base of the PR and between 893572e and 6de2372.

📒 Files selected for processing (1)
  • app/client/src/widgets/CheckboxWidget/widget/index.tsx
 ____________________________________________________________
< In God we trust. All others must go through a code review. >
 ------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review 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: Pro

Run ID: 9b5b195b-ce17-4183-8aa0-b364b4830e0a

📥 Commits

Reviewing files that changed from the base of the PR and between 893572e and 6de2372.

📒 Files selected for processing (1)
  • app/client/src/widgets/CheckboxWidget/widget/index.tsx
💤 Files with no reviewable changes (1)
  • app/client/src/widgets/CheckboxWidget/widget/index.tsx

Walkthrough

CheckboxWidget removes automatic synchronization of the isChecked meta property when props.isChecked changes with onCheckChange configured. The remaining componentDidUpdate logic clears the isDirty flag when defaultCheckedState changes. This prevents onCheckChange from triggering on programmatic state updates while maintaining dirty-state management.

Changes

Checkbox Programmatic Sync Fix

Layer / File(s) Summary
Event Handler Synchronization Removal
app/client/src/widgets/CheckboxWidget/widget/index.tsx
Removed 9-line componentDidUpdate block that synchronized isChecked meta property on props.isChecked changes, eliminating unwanted onCheckChange event triggers during programmatic state updates.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A checkbox once fired on its own,
When code changed it—no click, no moan,
Now sync is gone, clean and right,
Only user taps light the night,
Bug flies away, logic stays tight. ✓

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description lacks the required template structure with sections like Automation and Communication checkboxes, though it does reference the issue and explain the change clearly. Follow the repository's description template by adding Automation section with /ok-to-test tags and Communication section with checkboxes for DevRel/Marketing notification.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: preventing onCheckChange from firing during programmatic updates, which matches the core change in the PR.
Linked Issues check ✅ Passed The PR directly addresses issue #41505 by removing the programmatic update synchronization block that was causing onCheckChange to fire on non-user-triggered state changes.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to the CheckboxWidget's componentDidUpdate method, removing only the problematic programmatic sync logic while preserving other functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: onCheckChange triggers when Checkbox state is updated programmatically

1 participant