broker/Data/data_to_val: Fail on vectors/lists with holes

Instead of simply removing holes from vectors or lists when converting
from Val to Broker format, error out as the receiver has no chance to
reconstruct where the hole might have been.

We could encode holes with broker::none, but this will put unnecessary
burden on language bindings and users due to the potential optionality.
Think a std::vector<uint64_t> that technically needs to be a
std::vector<std::optional<uint64_t>> to represent optional elements
properly.

Closes #3045
This commit is contained in:
Arne Welzel 2025-04-28 14:36:11 +02:00
parent b9b268bd86
commit 7092db6318
7 changed files with 121 additions and 4 deletions

6
NEWS
View file

@ -17,6 +17,12 @@ New Functionality
Changed Functionality
---------------------
- Publishing remote events with vector arguments that contain holes is now
rejected. The receiver side never had a chance to figure out where these
holes would have been. There's a chance this breaks scripts that accidentally
published vectors with holes. A reporter error is produced at runtime when
serialization of vectors with holes is attempted.
Removed Functionality
---------------------