Fix transaction conflict in TryResurrectParent (bd-58c0)
Refactored resurrection functions to accept optional *sql.Conn parameter: - Added tryResurrectParentWithConn() internal function - Added tryResurrectParentChainWithConn() internal function - Updated CreateIssue to use conn-based resurrection - Updated EnsureIDs to use conn-based resurrection This eliminates 'database is locked' errors when resurrection happens inside an existing transaction. Fixes bd-58c0
This commit is contained in:
@@ -197,7 +197,9 @@ func TestCreateIssue_HierarchicalID_ParentNotExists(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Errorf("expected error for child without parent, got nil")
|
||||
}
|
||||
if err != nil && err.Error() != "parent issue bd-nonexistent does not exist" {
|
||||
t.Errorf("unexpected error message: %v", err)
|
||||
// With resurrection feature, error message includes JSONL history check
|
||||
expectedErr := "parent issue bd-nonexistent does not exist and could not be resurrected from JSONL history"
|
||||
if err != nil && err.Error() != expectedErr {
|
||||
t.Errorf("unexpected error message: got %q, want %q", err.Error(), expectedErr)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user