You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically this just creates a message and attempts to set the value. Included is also a message that does not use predefined rules to compare the behaviour.
Expected Behavior
We should be able to set the value safely and run validation.
Actual Behavior
We are seeing a panic instead.
Environment
Operating System: macOS
Version: Sonoma 14.6
Compiler/Toolchain: go version go1.23.1 darwin/arm64
Using a repeated field as a predefined rule value results in a panic, as
CEL cannot convert a `protoreflect.List` value into a valid CEL type.
This results in an error value standing in for the list's value in the
expression. When attempting to optimize the expression via computing
residuals, a type assertion without the guard boolean (i.e., `typed :=
unknown.(T)` instead of `typed, ok := unknown.(T)`) triggers the panic
on this non-list error value.
This patch adds a new helper to the celext package to compute an
appropriate value for any `protoreflect.Value` given its field
descriptor.
Fixes#148
Description
When setting a value for a field with predefined rules, we get a panic:
Steps to Reproduce
This is an example repository with a repro: https://github.com/doriable/pv-go-bug
Basically this just creates a message and attempts to set the value. Included is also a message that does not use predefined rules to compare the behaviour.
Expected Behavior
We should be able to set the value safely and run validation.
Actual Behavior
We are seeing a panic instead.
Environment
The text was updated successfully, but these errors were encountered: