Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix database configuration parsing for string representations of arrays #3275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Copilot wants to merge 5 commits into develop
base: develop
Choose a base branch
Loading
from copilot/fix-3203
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions util/config.go
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,16 @@ func CastValueToKind(value any, kind reflect.Kind) (res any, ok bool) {
res = castStringToBool(fmt.Sprintf("%v", reflect.ValueOf(value)))
ok = true
}
case reflect.Slice:
// Handle string representations of slices, e.g., `["-u semaphore -b"]`
if str, isString := value.(string); isString {
var arr []string
err := json.Unmarshal([]byte(str), &arr)
if err == nil {
res = arr
ok = true
}
}
Copy link

@cursor cursor bot Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Slice Unmarshalling Fails for Non-String Types

The CastValueToKind function's reflect.Slice case always unmarshals string representations into a []string. This leads to a type mismatch panic when assigning to configuration fields expecting slices with different element types (e.g., []int, []bool), as reflect.Kind lacks the necessary element type information.

Fix in Cursor Fix in Web

default:
}

Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /