[Package] - Limit display result size for pieces
Opened this issue · 0 comments
vinicvaz commented
We aim to restrict the size of data stored in the BasePiece.display_result property, as these values are transmitted to the frontend for UI rendering. Allowing excessively large data might lead to performance issues in front-to-back communication.
To prevent this, maybe we can limit the display_result
property to a specific number of bytes. This ensures that developers working on new pieces won't inadvertently save excessively large data, thereby mitigating potential performance problems.
Something like this would solve:
@property
def display_result(self):
return self._display_result
@display_result.setter
def display_result(self, value):
max_bytes = 10
if size_in_bytes(value) > max_bytes:
raise SomeException
self._display_result = value