Executing a Lua script returning a List response fails during response processing (e.g. applying map or filter operators) with a ClassCastException because of single element emission instead of emitting a list.
Lettuce emits each element of the returned list as single element but the generic types between RedisScript and the returned Flux do not match:
After a few iterations, I'm coming to the conclusion that emitting List<T> instead of T might make the most sense for Lua scripting instead of resolving a List<T> and emitting T.
The most convincing reasons are returning null – skipping these would garble up the response – and in several cases, the response array is required as List. We would also match the existing generic signatures and returning the List as-is would align with the imperative scheme