cncf / cncf/maintainer-d

SearchUsers pagination loop has no page/row ceiling

Open
#163 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
9
Forks
10
Avg merge
16h 55m
Merged PRs (30d)
6

Description

## Problem

`lfx.Client.SearchUsers` (`lfx/client.go`) now paginates to exhaustion (fixed in #161 / commit `d453defd`), looping on `offset` until it sees a short page or `offset >= Metadata.TotalSize`. That's correct for a well-behaved endpoint, but there is no upper bound on page count or accumulated rows.

If the LFX user-service ever returns a full page while ignoring the `offset` query param (a plausible legacy-API behavior) and reports `TotalSize: 0` or an incorrect total, the loop never terminates and the `users` slice grows without bound — an unbounded-memory / hung-request failure mode for a single enrichment lookup.

## Suggested direction

Add a sane ceiling (e.g. a max page count or max total rows, logged as a warning/error if hit) so a misbehaving endpoint degrades to a bounded partial result instead of hanging the sync/web-bff request indefinitely.

## Origin

Surfaced during PR #157 post-merge issue triage, while verifying #161 was fixed by `d453defd`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in lfx/client.go at Client.SearchUsers and trace the offset pagination introduced by #161 and commit d453defd. Decide on a bounded page or row limit, including how a warning or error is reported when it is reached. Done means a misbehaving endpoint returns a bounded partial result instead of hanging or growing users without limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.