Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(cli): keep member names off free-form property lists (#9093)
2penheimer13520a0d131f
diff --git a/server/cmd/multica/cmd_property.go b/server/cmd/multica/cmd_property.goindex a8b911eb01..5564507319 100644--- a/server/cmd/multica/cmd_property.go+++ b/server/cmd/multica/cmd_property.go@@ -722,8 +722,12 @@ func issuePropertyDisplayValues(property propertyDTO, value any, actorNames map[names = append(names, formatMetadataValue(item))case property.Type == "multi_select":names = append(names, propertyOptionName(property, s))- default:+ case property.Type == "multi_actor":names = append(names, actorPropertyName(actorNames, s))+ default:+ // multi_text and multi_url are free-form. A string that happens to+ // equal a member reference is still the text the user stored.+ names = append(names, s)}}return namesdiff --git a/server/cmd/multica/cmd_property_test.go b/server/cmd/multica/cmd_property_test.goindex d88a75e308..74f9671aad 100644--- a/server/cmd/multica/cmd_property_test.go+++ b/server/cmd/multica/cmd_property_test.go@@ -57,6 +57,34 @@ func TestBuildIssuePropertyRowsMultiValueDisplays(t *testing.T) {}}+// Free-form lists are stored and shown as the caller wrote them. Member-name+// lookup belongs to actor properties only: a multi_text or multi_url entry+// that happens to equal a member reference must not be replaced by that+// member's name.+func TestIssuePropertyDisplayValuesFreeFormListsIgnoreActorNames(t *testing.T) {+ ref := "member:abababab-2222-4222-8222-222222222222"+ actorNames := map[string]string{ref: "Ada"}++ aliases := propertyDTO{ID: "p-aliases", Name: "Aliases", Type: "multi_text"}+ gotText := issuePropertyDisplayValues(aliases, []any{ref, "plain"}, actorNames)+ wantText := []string{ref, "plain"}+ if !reflect.DeepEqual(gotText, wantText) {+ t.Fatalf("multi_text display_values = %v, want %v", gotText, wantText)+ }++ links := propertyDTO{ID: "p-links", Name: "Links", Type: "multi_url"}+ gotURL := issuePropertyDisplayValues(links, []any{ref}, actorNames)+ if !reflect.DeepEqual(gotURL, []string{ref}) {+ t.Fatalf("multi_url display_values = %v, want [%s]", gotURL, ref)+ }++ owners := propertyDTO{ID: testReviewerDefID, Name: "Owners", Type: "multi_actor"}+ gotActors := issuePropertyDisplayValues(owners, []any{ref}, actorNames)+ if !reflect.DeepEqual(gotActors, []string{"Ada"}) {+ t.Fatalf("multi_actor display_values = %v, want [Ada]", gotActors)+ }+}+func TestFormatIssuePropertyValueMultiValueNotArray(t *testing.T) {platforms := propertyDTO{ID: testPlatformsDefID, Name: "Platforms", Type: "multi_select"}// A value that is not an array falls through to the raw rendering and