Skip to content

[bug]: GitHub Integration Not Working in Settings #1036

@thisisharsh7

Description

@thisisharsh7

Bug Description

The GitHub integration in Settings > Integrations is completely broken and non-functional. Users cannot connect their GitHub account (clicking the "+" button does nothing), and users who are already connected cannot properly disconnect (the logout doesn't actually work).

This issue consists of two related problems:

  1. Connect button shows nothing: Clicking the "+" button starts authentication in the background but no modal appears to show the device code to the user
  2. Disconnect button doesn't logout: Clicking the "✓" checkmark only clears the keychain but doesn't logout of GitHub CLI, so the user remains connected

Both problems must be fixed together to restore GitHub integration functionality.

Steps to Reproduce

To reproduce Problem 1 (Connect button):

  1. Open Emdash application
  2. Open Settings (⚙️ icon or Cmd+,)
  3. Navigate to the Integrations tab
  4. Locate the "GitHub - Connect your repositories" card
  5. Click the "+" button (add/connect button)
  6. Observe the result

To reproduce Problem 2 (Disconnect button):

  1. Ensure you are already connected to GitHub (card shows "✓" checkmark button)
  2. Click the "✓" checkmark button to disconnect
  3. Wait a few seconds
  4. Observe the GitHub card status
  5. (Optional) Run gh api user in terminal to verify GitHub CLI is still authenticated

Actual vs Expected Behavior

Actual

Connecting:

  • User clicks the "+" button to connect GitHub
  • Nothing happens - no modal, no feedback, no error
  • User is stuck and confused

Disconnecting:

  • User clicks the "✓" checkmark to disconnect
  • App appears to process the request
  • Refresh the page
  • User remains connected (still shows ✓)
  • GitHub CLI is still authenticated in the background

emdash Version

latest

Operating System

macOS

Additional Context

Problem 1: Connect Button

Expected Behavior:

  • A modal should appear showing a device code
  • The GitHub card should update to show a "✓" checkmark indicating connected state

Actual Behavior:

  • Nothing visible happens when clicking the "+" button
  • No modal appears
  • No device code is displayed
  • No error message is shown
  • User is left without any feedback or way to proceed
  • Authentication starts silently in the background but user cannot see the device code

Root Cause:

  • File: src/renderer/components/IntegrationsCard.tsx
  • The handleGithubConnect function calls login() which initiates the OAuth device flow
  • However, the GithubDeviceFlowModal component is never imported or rendered
  • The modal component exists at src/renderer/components/GithubDeviceFlowModal.tsx but is unused

Problem 2: Disconnect Button

Expected Behavior:

  • User clicks the "✓" checkmark button
  • App runs gh auth logout to logout of GitHub CLI
  • App clears the keychain token
  • Status check returns authenticated: false
  • UI updates to show the "+" button again (disconnected state)

Actual Behavior:

  • User clicks the "✓" checkmark button
  • App only clears the keychain token
  • GitHub CLI (gh) remains logged in
  • Status check runs gh api user which still succeeds
  • Status still returns authenticated: true
  • UI continues to show the "✓" checkmark (connected state)
  • User believes they are logged out, but they are not (security/privacy concern)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions