Skip to content

Advanced Matching checkbox gets unchecked when typing in Expected Value field #3093

@khoazero123

Description

@khoazero123
bandicam.2025-12-26.15-33-04-334.mp4

Description

The "Advanced matching" checkbox in the Uptime Monitor editing page gets automatically unchecked when users type in the "Expected value" field. Additionally, after saving data and reloading the page, the checkbox remains unchecked even when expectedValue or jsonPath fields contain data.

Steps to Reproduce

  1. Navigate to Uptime Monitor creation/editing page (/uptime/create or /uptime/configure/:id)
  2. Select monitor type as "http"
  3. Check the "Advanced matching" checkbox
  4. Start typing in the "Expected value" field
  5. Observe that the checkbox gets unchecked immediately

Alternative scenario:

  1. Create/edit a monitor with advanced matching enabled
  2. Fill in expectedValue or jsonPath fields
  3. Save the monitor
  4. Reload the page
  5. Observe that the "Advanced matching" checkbox is unchecked despite having data in the fields

Expected Behavior

  • The "Advanced matching" checkbox should remain checked when typing in the "Expected value" or "JSON Path" fields
  • After saving and reloading, if matchMethod, expectedValue, or jsonPath contains data, the checkbox should be automatically checked

Actual Behavior

  • The checkbox gets unchecked immediately when typing in "Expected value" field
  • After reloading, the checkbox remains unchecked even when advanced matching fields contain data

Root Cause

The useEffect hook that manages the checkbox state was watching the entire monitor object, causing it to re-run on every keystroke. Additionally, it only checked for monitor.matchMethod existence, ignoring expectedValue and jsonPath fields.

Proposed Solution

  1. Update the useEffect dependency array to only watch monitor.matchMethod, monitor.expectedValue, and monitor.jsonPath instead of the entire monitor object
  2. Modify the condition to check for any of the three fields (matchMethod, expectedValue, or jsonPath) instead of just matchMethod
  3. Add logic in the onChange handler to automatically check the checkbox when users type in expectedValue or jsonPath fields

Environment

  • Checkmate version: 3.2.0
  • Browser: [Any]
  • OS: [Any]

Additional Context

This issue affects the user experience when configuring HTTP monitors with advanced matching rules, as users need to manually re-check the checkbox every time they type in the expected value field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions