Skip to content

Implement cursor/keyset pagination + soft-delete scoping for Users and Tags (mirror Posts fix) #614

Description

@grantfox-oss

Module: meridian-api/src/users, meridian-api/src/tag, meridian-api/src/common

Problem
Issue #8 fixed Posts pagination, but users.controller.ts and
tag/tag.controller.ts appear to still use offset ParseIntPipe pagination with
no cursor support and no soft-delete global filter. User listing likely leaks
deactivated accounts and Tags has no uniqueness/normalization, so the same tag
("DeFi" vs "defi") fragments. There is also no N+1 guard for users' related
entities (posts, metaoptions) — common/pagination exists but isn't reused.

Deliverables

  • Reuse the common/pagination keyset implementation for UsersService and
    TagsService; return { data, nextCursor, total }.
  • Add a soft-delete scope so deactivated users / removed tags are excluded
    by default but restorable.
  • Normalize tags (lowercase/trim + unique index) and dedupe on create.
  • Add relations/join loading to kill N+1; prove with a query-count test.
  • Tests for cursor pagination, soft-delete exclusion, tag normalization.

Acceptance criteria

  • Cursor pagination + count assertion (no N+1) on both modules.
  • Deactivated users absent from listings.
  • Tag create dedupes; nest test green.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions