LookupResources optional_limit pagination: strict maximum or advisory limit
0 reputation · 10 Feb 2023, 22:09 UTC
When using LookupResources to paginate a large set of resources that grant a permission to a subject, the goal is to receive each page with a predictable maximum number of entries so that client‑side buffering and latency budgets can be fixed in advance.
The SpiceDB v1 API accepts an optional_limit field and returns an opaque after_result_cursor, but the documentation notes that the server may apply its own default or maximum page size, treating the request limit as advisory. It is unclear whether the limit is enforced as a strict upper bound, whether the server can return fewer items without signaling end‑of‑stream, and what guarantees exist for callers that need a hard cap on page size.
- Does the server guarantee that each LookupResources page contains no more than the requested optional_limit items?
- If the server can return fewer items, how should a client determine that the stream has ended versus merely receiving a partially filled page?
- If the server can exceed the requested limit, what mechanism (if any) enforces a hard bound on page size?