This PR fixes a bug that would cause corrupt/partially overridden data to be returned from endpoint methods that implement getPaginatedResults[T any](...) and have a large number of results.
This issue occurred because Resty's request objects are not designed to be executed multiple times. Specifically, the internal Request.Result pointer (initialized by us using SetResult(...)) is not implicitly reset when executing a request multiple times, leading to new data being written on top of existing data.
✔️ How to Test
Unit Testing
make testunit
Manual Testing
Excluding manual testing steps for now since it requires a large number of resources (~ >200).
📝 Description
This PR fixes a bug that would cause corrupt/partially overridden data to be returned from endpoint methods that implement
getPaginatedResults[T any](...)
and have a large number of results.This issue occurred because Resty's request objects are not designed to be executed multiple times. Specifically, the internal
Request.Result
pointer (initialized by us usingSetResult(...)
) is not implicitly reset when executing a request multiple times, leading to new data being written on top of existing data.✔️ How to Test
Unit Testing
Manual Testing
Excluding manual testing steps for now since it requires a large number of resources (~ >200).