fix(export): populate export_hashes after successful export (GH#1278) (#1286)
Child issues created with --parent were missing from export_hashes table, which affects integrity tracking and future incremental export features. This fix ensures SetExportHash() is called for all exported issues: - Updated ExportResult to include IssueContentHashes map - Updated finalizeExport() to call SetExportHash() for each exported issue - Updated exportToJSONLDeferred() to collect content hashes during export - Updated performIncrementalExport() to collect content hashes for dirty issues - Updated exportToJSONLWithStore() to call SetExportHash() after export - Updated daemon's handleExport() to call SetExportHash() after export Added test TestExportPopulatesExportHashes to verify the fix works for both regular and hierarchical (child) issue IDs. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -205,6 +205,17 @@ func (s *Server) handleExport(req *Request) Response {
|
||||
fmt.Fprintf(os.Stderr, "Warning: failed to clear dirty flags: %v\n", err)
|
||||
}
|
||||
|
||||
// Update export_hashes for all exported issues (GH#1278)
|
||||
// This ensures child issues created with --parent are properly registered
|
||||
for _, issue := range issues {
|
||||
if issue.ContentHash != "" {
|
||||
if err := store.SetExportHash(ctx, issue.ID, issue.ContentHash); err != nil {
|
||||
// Non-fatal, just log
|
||||
fmt.Fprintf(os.Stderr, "Warning: failed to set export hash for %s: %v\n", issue.ID, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Write manifest if configured
|
||||
if manifest != nil {
|
||||
manifest.ExportedCount = len(exportedIDs)
|
||||
|
||||
Reference in New Issue
Block a user