fix(config): skip webkit-specific validation when engine is not webkit
The performance profile validator rejected configs with zero-value webkit fields even when engine type was set to cef via DUMBER_ENGINE env var. Now checks both config and env var to skip webkit validation entirely for non-webkit engines.
- commit
- 144c362fbda7b9be879060f1314d726ad005c4af
- author
- brice · · 2026-03-19 18:36 UTC
- committer
- brice · · 2026-03-28 04:36 UTC
- parent
- ecda50c
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +11 -0
M internal/infrastructure/config/validation.go +11 -0
| @@ -3,6 +3,7 @@ package config | |||
| 3 | 3 | import ( | |
| 4 | 4 | "fmt" | |
| 5 | 5 | "net/url" | |
| 6 | + | "os" | |
| 6 | 7 | "sort" | |
| 7 | 8 | "strings" | |
| 8 | 9 | ||
| @@ -441,6 +442,16 @@ func validateSession(config *Config) []string { | |||
| 441 | 442 | func validatePerformanceProfile(config *Config) []string { | |
| 442 | 443 | var validationErrors []string | |
| 443 | 444 | ||
| 445 | + | // Performance profiles and webkit-specific tuning only apply to the webkit engine. | |
| 446 | + | // Check both config and DUMBER_ENGINE env var override. | |
| 447 | + | engineType := config.Engine.Type | |
| 448 | + | if envEngine := os.Getenv("DUMBER_ENGINE"); envEngine != "" { | |
| 449 | + | engineType = envEngine | |
| 450 | + | } | |
| 451 | + | if engineType != "" && engineType != "webkit" { | |
| 452 | + | return nil | |
| 453 | + | } | |
| 454 | + | ||
| 444 | 455 | // Validate profile name | |
| 445 | 456 | if !IsValidPerformanceProfile(config.Engine.Profile) { | |
| 446 | 457 | validationErrors = append(validationErrors, fmt.Sprintf( | |
| @@ -3,6 +3,7 @@ package config | |||||
| 3 | import ( | 3 | import ( | ||
| 4 | "fmt" | 4 | "fmt" | ||
| 5 | "net/url" | 5 | "net/url" | ||
| 6 | + | "os" | |||
| 6 | "sort" | 7 | "sort" | ||
| 7 | "strings" | 8 | "strings" | ||
| 8 | 9 | ||||
| @@ -441,6 +442,16 @@ func validateSession(config *Config) []string { | |||||
| 441 | func validatePerformanceProfile(config *Config) []string { | 442 | func validatePerformanceProfile(config *Config) []string { | ||
| 442 | var validationErrors []string | 443 | var validationErrors []string | ||
| 443 | 444 | ||||
| 445 | + | // Performance profiles and webkit-specific tuning only apply to the webkit engine. | |||
| 446 | + | // Check both config and DUMBER_ENGINE env var override. | |||
| 447 | + | engineType := config.Engine.Type | |||
| 448 | + | if envEngine := os.Getenv("DUMBER_ENGINE"); envEngine != "" { | |||
| 449 | + | engineType = envEngine | |||
| 450 | + | } | |||
| 451 | + | if engineType != "" && engineType != "webkit" { | |||
| 452 | + | return nil | |||
| 453 | + | } | |||
| 454 | + | ||||
| 444 | // Validate profile name | 455 | // Validate profile name | ||
| 445 | if !IsValidPerformanceProfile(config.Engine.Profile) { | 456 | if !IsValidPerformanceProfile(config.Engine.Profile) { | ||
| 446 | validationErrors = append(validationErrors, fmt.Sprintf( | 457 | validationErrors = append(validationErrors, fmt.Sprintf( | ||