Skip to content

[bug] Collection pagination pushes offset to SQL before the in-memory membership filter → wrong/truncated results #1430

Closed

Description

@mstomar125

Severity: medium · Confidence: high

For a collection_id-filtered query (ops/node_ops.rs:419-429,479-487), membership filtering happens in memory after the SQL query, but offset is pushed to the SQL layer where it skips rows of the unfiltered set → offset>0 over a collection returns wrong/missing members + unstable pagination. Separately, with limit=None the over-fetch is hardcoded to 1000 (line 421) → members outside the 1000 newest nodes are silently dropped.

Fix: drive collection-scoped queries from get_collection_members and apply offset/limit in memory; don't push offset to SQL.


Found via the 2026-06-18 multi-repo bug-hunt sweep. Confidence/severity from the sweep + spot-verification.

Activity

  1. mstomar125 commented on Jun 24, 2026

    @mstomar125
    ContributorAuthor

    Resolved in #1459. Collection-filtered queries are now scoped to the collection's members via NodeFilter::with_ids (bounded) with offset/limit applied IN MEMORY after the membership filter — no more pushing offset to SQL (which paged the unfiltered set) or the fixed 1000 over-fetch (which dropped members beyond the newest 1000). Empty collections short-circuit. Test: pagination over members vs global set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions