Skip to content

fix(sync): Add in-progress label and preserve non-dex labels#120

Merged
dcramer merged 5 commits intodcramer:mainfrom
adnankurt16:fix/github-label-management
Feb 17, 2026
Merged

fix(sync): Add in-progress label and preserve non-dex labels#120
dcramer merged 5 commits intodcramer:mainfrom
adnankurt16:fix/github-label-management

Conversation

@adnankurt16
Copy link
Contributor

Summary

Fixes #119

Two fixes for GitHub label management during sync:

1. Add dex:in-progress label for started tasks

buildLabels() only generated two status labels (dex:pending / dex:completed), so started tasks were indistinguishable from not-started ones on GitHub. Now checks isInProgress(task) to produce three states, matching Shortcut's three-state workflow support (PR #105).

Task State Label
Not started dex:pending
In progress dex:in-progress
Completed dex:completed

2. Preserve non-dex labels during sync updates

GitHub's issues.update() API replaces ALL labels, so manually-added labels (bug, team:frontend, etc.) were silently destroyed on every sync. Now:

  • CachedIssue stores allLabels (all labels) alongside labels (dex-only, for change detection)
  • getIssueChangeResult() extracts non-dex labels from API response
  • updateIssue() merges non-dex labels back into the update payload
  • New issue creation is unaffected (only dex labels)

Test plan

  • All 897 tests pass (43 test files)
  • New: started task gets dex:in-progress label
  • New: pending task gets dex:pending label (not dex:in-progress)
  • New: label change from pending to in-progress detected in cache
  • New: non-dex labels preserved during syncAll (cached path)
  • New: non-dex labels preserved during syncTask (non-cached path)
  • New: new issue creation only has dex labels
  • Updated: fetchAllDexIssues stores both filtered and all labels

Two fixes for GitHub label management:

1. Add dex:in-progress label for started tasks. Previously both
   "not started" and "in progress" tasks got dex:pending, making
   them indistinguishable on GitHub. Now buildLabels() checks
   task.started_at to produce three states: pending, in-progress,
   completed — matching Shortcut's three-state workflow support.

2. Preserve non-dex labels during sync updates. The GitHub API
   replaces all labels when updating, so manually-added labels
   (bug, team:frontend, etc.) were silently destroyed on every
   sync. Now CachedIssue stores allLabels, and updateIssue()
   merges non-dex labels back into the update payload.

Fixes dcramer#119

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 10, 2026

@adnankurt16 is attempting to deploy a commit to the David Cramer's projects Team on Vercel.

A member of the Team first needs to authorize it.

When skipUnchanged is false and no cache exists, fetchIssueState()
only retrieved the issue state but not labels. This left nonDexLabels
empty, causing non-dex labels to be wiped on update.

Replace fetchIssueState() with fetchIssueStateAndLabels() that also
extracts non-dex labels from the API response, ensuring they are
preserved in all code paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
adnankurt16 and others added 3 commits February 11, 2026 02:27
When skipUnchanged is false and a cached issue exists, the code skipped
both the skipUnchanged block and the !cached branch, leaving nonDexLabels
empty. Add an else branch to extract non-dex labels from cache.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Subtasks with started_at rendered as 🔄 in GitHub issue summary lines,
matching the ✅ indicator already used for completed subtasks. Pending
subtasks show no indicator.

Parsing regex updated to also match 🔄 emoji so in-progress subtasks
are correctly parsed from issue body during import and sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three fixes to protect non-dex labels from being silently destroyed:

1. getIssueChangeResult() catch: return hasChanges: false instead of
   true. When the GET fails, skip the update rather than proceeding
   with empty nonDexLabels that would overwrite user-applied labels.

2. fetchIssueStateAndLabels(): remove swallowing try/catch. This path
   (skipUnchanged=false) guarantees an update will proceed, so if we
   can't fetch labels, the error must propagate rather than silently
   wiping them.

3. updateIssue() nonDexLabels parameter: remove default value (= [])
   to make it required. Future callers that forget to pass labels get
   a compile error instead of silent data loss.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dcramer dcramer merged commit 6ae7d06 into dcramer:main Feb 17, 2026
2 of 3 checks passed
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.

GitHub sync: Missing in-progress label + non-dex labels overwritten on update

2 participants

Comments