Skip to content

feat(creators): add pagination boundary warning logs for out-of-range…#349

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
dinahmaccodes:issue210
May 30, 2026
Merged

feat(creators): add pagination boundary warning logs for out-of-range…#349
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
dinahmaccodes:issue210

Conversation

@dinahmaccodes

Copy link
Copy Markdown
Contributor

Summary

This PR implements structured warning logs for out-of-range or invalid pagination cursors in the GET /api/v1/creators endpoint. It improves observability and debugging capabilities for future cursor-based navigation without altering the existing offset-pagination response behavior.

Key Changes

  • Query Schema Update: Added the optional cursor parameter to CreatorListQuerySchema (creators.schemas.ts) with normalization to prevent 400 Bad Request validation errors.
  • Cursor Boundary Warning Utility: Created warnIfOutOfRangeCursor (creators.cursor-warning.utils.ts) to:
    • Safely decode cursors.
    • Query the database to check if the referenced creator profile exists and matches the active query filters (verified, search).
    • Log structured warnings via logger.warn including route, cursor, and metadata.
    • Handle exceptions gracefully to keep API responses unaffected.
  • Controller Integration: Integrated the warning checks within httpListCreators (creators.controllers.ts).
  • Tests: Implemented comprehensive integration tests in creators.cursor-warning.integration.test.ts validating all cursor states (valid, invalid, non-existent, and mismatched filters).

Verification Results

  • Ran integration tests locally via Jest: PASS
  • Ran formatter, linter, and build checks: PASS

Closes #210

@drips-wave

drips-wave Bot commented May 29, 2026

Copy link
Copy Markdown

@dinahmaccodes Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dinahmaccodes

Copy link
Copy Markdown
Contributor Author

@Chucks1093
please review
checks are all passing

@Chucks1093 Chucks1093 merged commit c08f517 into accesslayerorg:main May 30, 2026
1 check 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.

Add pagination boundary warning logs for out-of-range cursors

2 participants