🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
HTML MASTER CLASS /// LEARN TAGS /// BUILD STRUCTURE /// SEMANTIC WEB /// HTML MASTER CLASS /// LEARN TAGS ///

Untitled Lesson

Total XP: 0|💻 backend XP: 0

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

Select an unlocked node to view details root

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Common Pitfalls & Errors

The Error //

Exposing the cursor's internal structure directly to the client instead of an opaque encoded token

// Wrong: internal structure exposed directly ?cursorCreatedAt=2024-01-15&cursorId=42 // Correct: opaque, encoded token ?cursor=eyJjcmVhdGVkQXQiOiIyMDI0LTAxLTE1IiwiaWQiOjQyfQ==

The Solution //

If a client can see and potentially construct or manipulate the cursor's internal fields directly, it couples the client to the server's internal implementation, making it much harder to change the cursor's structure later without breaking existing clients — and it also risks a client crafting an invalid or malicious cursor value.

The Error //

Choosing cursor pagination for a UI that genuinely requires arbitrary page-number jumping

// Cursor pagination cannot support this UI requirement: // "Page: [1] [2] [3] ... [47] [Next]" — jump to page 23 directly // For this need, offset pagination is the better-suited choice

The Solution //

Cursor pagination fundamentally only supports sequential movement (the next or previous page relative to a specific cursor) — it cannot support jumping directly to an arbitrary page number, since there's no concept of page numbers at all. For a UI genuinely requiring this (like an admin table with numbered page links), offset pagination remains the more appropriate choice despite its other tradeoffs.

Continue Learning