Skip to content

fix(leads): exclude dead records before pagination - #62

Merged
debpalash merged 1 commit into
debpalash:mainfrom
rudycelekli:fix/leads-filter-dead-before-pagination-20261006
Oct 7, 2026
Merged

debpalash merged 1 commit into
debpalash:mainfrom
rudycelekli:fix/leads-filter-dead-before-pagination-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

What changed

  • Exclude dead leads in the store query before applying the lead list's limit and offset. The route previously paginated all statuses and then removed dead leads in Python, producing incomplete pages and incorrect visible-row offsets.
  • Add the same optional filter to SQLite LeadDB and the ORM PgLeadStore; its default preserves existing store callers. The explicit status=dead view remains available, and null statuses retain their prior behavior.

Verified

Native public POST /api/lead, PUT /api/lead/{id} and GET /api/leads requests seed and read five persisted leads with interleaved dead/active scores.

Upstream main This branch
A two-record default page contains only Active first because the highest record is removed after pagination. The first page contains Active first, Active second; offset 2 returns Active third.
The same defect occurs for the __all__ status selection in both stores. Both default/__all__ selections paginate visible rows; the explicit dead view still returns both dead records.
  • Four before regressions fail on main; six new route regressions pass here. Focused pagination/store/create suite: 16 passed.
  • The store checks use native file-backed SQLite and the genuine ORM store against SQLAlchemy SQLite, following the repository's existing parity-test pattern. No fake store or query implementation replaces either path.
  • Frozen backend CI selection: 1,884 passed, 131 skipped, 3 deselected, 2 deprecation warnings. Exact signed head focused suite also passes.
  • Actual PostgreSQL service tests were not run locally; hosted checks remain pending. No frontend source changed, and no frontend build is claimed.
  • Freshly screened all open PR files: no overlap with these source or regression files.

AI assistance: implemented and tested with Codex on behalf of Rudy Celekli. The exact signed DCO patch received a separate source review before publication.

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
@rudycelekli
rudycelekli requested a review from debpalash as a code owner October 6, 2026 16:00
@debpalash
debpalash merged commit 12b4b37 into debpalash:main Oct 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants