Skip to content

Synrk can't sync some forks even though the TUI display "Synchronization Done" #30

Open

Description

@thetnaingtn

Synchronization with upstream repository doesn't work for certain forks. The TUI display "Synchronization Done" but the fork are still behind the upstream repositories and there is no ✓ mark display.

Current Behavior

synrk can't synchronize forks which are fall behind their corresponding upstream repository.

Acceptance Criteria

synrk should synchronize forks which are fall behind their corresponding upstream repository.

Validation

Require to validate with synrk -t <github_token> and do navigate through forks select with space and then merge with m.

Activity

  1. thetnaingtn commented on May 17, 2026

    @thetnaingtn
    OwnerAuthor

    @claude fix this issue

  2. claude commented on May 17, 2026

    @claude

    Claude finished @thetnaingtn's task in 14m 10s —— View job • claude/issue-30-20260517-0437 • Create PR ➔


    Fixing: Sync not working despite showing "Synchronization Done"

    • Read relevant source files to understand the bug
    • Identify root cause
    • Fix SyncBranchWithUpstreamRepo nil resp dereference
    • Fix item rendering to show sync errors via errMsg
    • Commit and push changes

    Root cause analysis:

    Two bugs were found and fixed:

    Bug 1 — nil pointer panic in SyncBranchWithUpstreamRepo (internal/synrk/synrk.go):
    The code accessed resp.StatusCode before checking err. On transport-level failures (timeout, DNS error), resp is nil, causing a panic. Fixed by checking err != nil first, and only then checking resp.StatusCode within the error branch (guarded by resp != nil).

    Bug 2 — sync errors silently hidden in the UI (internal/ui/item.go):
    When a sync failed, item.errMsg was populated by mergeReposCmd but Title() and Description() only checked i.repo.Error (a fetch-phase error), never i.errMsg. So failed syncs showed the ● (selected) icon instead of ⨯ (error), while the title still said "✅ Synchronization Done" — giving no feedback to the user.

    Fixed by updating Title() to check i.errMsg != "" alongside i.repo.Error, and adding an errMsg branch to Description() that shows the sync failure reason.

    |

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

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