Merge Button Disabled After Failed Merge Attempt (SZ-111)
rk@tigase.net opened 5 days ago

Summary

After a merge fails, the Merge button remains disabled until the user navigates away from the PR and returns. This prevents immediate retry after fixing the underlying issue (e.g., updating credentials).

Steps to Reproduce

  1. Create a pull request in Sztab
  2. Attempt to merge with invalid credentials or other error condition
  3. Observe merge failure with error message
  4. Fix the underlying issue (e.g., update PAT in database)
  5. Attempt to click "Merge" button again

Expected Behavior

  • After a failed merge, the user should be able to retry the merge immediately
  • The Merge button should be enabled and clickable after error is displayed

Actual Behavior

  • The Merge button remains disabled after a failed merge attempt
  • User must navigate away from the PR detail page and return to re-enable the button
  • Error state persists in the UI component

Workaround

Navigate away from the PR (e.g., go to PR list) and return to the PR detail page. The Merge button will be enabled again.

Root Cause

React mutation state (merge.isPending or error state) is not properly reset after a failed merge attempt, leaving the button in a disabled state.

Proposed Fix

In src/pages/pr/PrDetailPage.tsx, add merge.reset() in the onError handler to clear the mutation state:

onError: (error: unknown): void => {
    if (error instanceof Error) {
        setMergeError(error.message);
    } else {
        setMergeError("Merge failed");
    }
    merge.reset();  // Clear mutation state to allow retry
}

Severity

Low - Minor UX annoyance with simple workaround

Priority

P3 - Fix in next minor release (1.9.4 or later)

Environment

  • Version: 1.9.3
  • Component: Frontend (React UI)
  • File: src/pages/pr/PrDetailPage.tsx
  • Successfully validated credential refresh feature works correctly (credentials can be updated in DB without restart)
  • rk@tigase.net changed state to 'In Progress' 5 days ago
    Previous Value Current Value
    Open
    In Progress
  • rk@tigase.net commented 5 days ago

    Found as apart of regression test of 1.9.3 release. Fixing it directly on mainline (wolsonsc).

    In src/pages/pr/PrDetailPage.tsx, add merge.reset() in the onError handler to clear the mutation state:

    onError: (error: unknown): void => {
        if (error instanceof Error) {
            setMergeError(error.message);
        } else {
            setMergeError("Merge failed");
        }
        merge.reset();  // Clear mutation state to allow retry
    }
    
    
  • rk@tigase.net commented 4 days ago

    Fixed in 1.9.3

  • rk@tigase.net changed state to 'Closed' 4 days ago
    Previous Value Current Value
    In Progress
    Closed
  • rk@tigase.net referenced from other issue 4 days ago
issue 1 of 1
Type
Bug
Priority
Minor
Assignee
Version
1.9.1
Sprints
n/a
Customer
n/a
Issue Votes (0)
Watchers (3)
Reference
SZ-111
Please wait...
Page is in error, reload to recover