Skip to content

Fix cursor pagination compatibility and index coverage #40

@Jing-yilin

Description

@Jing-yilin

Summary

Address Codex review findings from PR #38:

🔴 High Priority - Cursor Format Incompatibility

  • DB uses base64 offsets, ScrapingBee uses page:N format
  • Causes pagination resets and wasted credits
  • Add "hot" to sortMap to prevent sort degradation

🟡 Medium Priority - Incomplete Index Coverage

  • Missing indexes for category+newest, category+ending
  • Deadline predicate not indexed for trending/newest
  • Performance degrades as table grows with expired rows

Proposed Fixes

  1. Cursor compatibility: Add "hot" to sortMap, prevent fallback cycling
  2. Index coverage: Add composite indexes with deadline predicate
  3. Add handler tests: Validate pagination and filtering behavior

References

Codex review: commit 1173168 (PR #38 merge)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions