fix(sync): Create subtasks during bulk import and sync pull#122
Closed
fix(sync): Create subtasks during bulk import and sync pull#122
Conversation
Subtasks embedded in GitHub issue bodies (as <details> blocks) were only created during single-issue import. Three flows were broken: - `dex import --all` only created parent tasks - `dex import #N --update` only updated the parent task - `dex sync` pull path skipped subtasks not found locally Extract importSubtasksFromIssueBody helper from the working single-import path and reuse it across all import flows. For sync pull, extend SyncResult with needsCreation/createData fields so reconcileSubtasksFromRemote can signal that new local subtasks should be created. Fixes #117 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
reconcileSubtasksFromRemote checked store.tasks for parent existence, but when multiple nested subtasks are created in the same sync batch, parents processed earlier in the batch weren't visible. This caused grandchild subtasks to be flattened to the root task instead of preserving hierarchy. Track processed subtask IDs so nested subtasks can resolve parents that are also being created in the same sync operation. Fixes part of #119 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
importSubtasksFromIssueBody called service.list({ all: true }) on every
invocation, causing O(n) file reads during bulk import (once per issue).
The task list was already fetched by callers, so pass it through instead
of re-fetching.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mote results syncAll results with pulledFromRemote=true were also marked skipped=true (since nothing was pushed to remote). The saveMetadata loop filtered out all skipped results, so local updates (completion state, timestamps) and subtask creation from remote were never applied. Allow pulledFromRemote results through the filter so that: - Parent task completion/timestamps are updated from remote - Subtasks found in remote issue body are created locally Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
started_at was parsed from GitHub issue metadata comments but never passed to service.create() or service.update(). This caused imported tasks and subtasks to lose their in-progress state. Fixed in 4 places: - importGitHubIssueAsTask (parent task create) - importSubtasksFromIssueBody (subtask create) - importSubtasksFromIssueBody (subtask update) - reconcileSubtasksFromRemote (sync pull createData) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
UpdateTaskInputSchema used .optional() for result and metadata, meaning only undefined (skip) and string/object (set) were valid. This prevented clearing these fields via null during import --update. Added .nullable() to match the pattern already used by parent_id and started_at. Now undefined = skip, null = clear, value = set. Removed ?? undefined workarounds in import subtask update path so null values from remote are properly passed through to clear local fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflict in specs/sync.md: keep both Subtask Sync and Labels sections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix metadata replacement bug in importSubtasksFromIssueBody that would wipe integration metadata (github/shortcut keys) when updating existing subtasks — now merges with existing metadata - Change createData type from Record<string, unknown> to CreateTaskInput for compile-time type safety, removing unsafe cast in saveMetadata - Add end-to-end test for sync pull creating subtasks locally - Add test for --update updating existing subtasks (not just creating) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
Closing in favor of #118 which has been updated directly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supersedes #118. Fixes three broken flows where subtasks embedded in GitHub issue bodies were not being created locally:
dex import --all— only created parent tasks, skipped subtasksdex import #N --update— only updated the parent task, ignored new subtasks in the bodydex syncpull path — when remote was newer, subtasks not found locally were silently skippedChanges
importSubtasksFromIssueBodyhelper for create + update of subtasks during importreconcileSubtasksFromRemoteto returnneedsCreation/createDatafor subtasks that exist remotely but not locallysaveMetadatafilter to includepulledFromRemoteresults (previously filtered out byskippedcheck)createDatatype fromRecord<string, unknown>toCreateTaskInputfor compile-time safetystarted_atto import path, allow nullableresult/metadatain UpdateTaskInputTest plan
dex import --allcreates subtasks from issue bodiesdex import #N --updatecreates new subtasks and updates existing onesdex syncpull path creates subtasks that only exist remotely🤖 Generated with Claude Code