Skip to content

fix: comma query parser, feed pagination constants, sort tie-breaker, empty feed test (#212-216)#221

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
nonsobethel0-dev:fix/issues-212-214-215-216
Apr 27, 2026
Merged

fix: comma query parser, feed pagination constants, sort tie-breaker, empty feed test (#212-216)#221
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
nonsobethel0-dev:fix/issues-212-214-215-216

Conversation

@nonsobethel0-dev
Copy link
Copy Markdown
Contributor

Fixes #212
Fixes #214
Fixes #215
Fixes #216

What changed

#212 — Shared helper for parsing comma-separated query values

  • src/utils/comma-query.utils.tsparseCommaQuery() accepts string | string[] | undefined | null; splits on commas, trims tokens, drops empty values, deduplicates (first-occurrence order preserved)
  • src/utils/test/comma-query.utils.test.ts — 18 tests: null/undefined, empty/whitespace, single/multi value, trimming, deduplication, array input, real-world tag filter strings

#214 — Creator feed default page-size constant module

  • src/constants/creator-feed-pagination.constants.tsCREATOR_FEED_DEFAULT_PAGE_SIZE, CREATOR_FEED_MAX_PAGE_SIZE, CREATOR_FEED_MIN_PAGE_SIZE — feed-specific constants that evolve independently from the generic pagination policy
  • src/modules/creators/creators.limit.utils.ts — updated resolveCreatorListLimit() to import from the new module and add min/max clamping

#215 — Stable sort tie-breaker helper for creator lists

  • src/utils/sort-tiebreaker.utils.tswithTieBreaker<T>() builds a comparator with primary key + ascending id tie-breaker; stableSortCreators() returns a sorted copy without mutating the input. Guarantees deterministic page output when primary keys are equal
  • src/utils/test/sort-tiebreaker.utils.test.ts — 12 tests: asc/desc, tie-break direction consistency, string/number primary keys, mutation safety, empty/single-item arrays

#216 — Integration test for empty creator activity feed

  • src/modules/activity/activity-feed-empty.integration.test.ts — 10 tests with mocked fetchActivityFeed([[], 0]); asserts response envelope shape (items[], meta.total=0, meta.hasMore=false), status 200, pagination params forwarded, creatorId filter passing through, and 400 on invalid query params

How to test

npm test

… empty feed test (accesslayerorg#212-216)

accesslayerorg#212 — Shared helper for parsing comma-separated query values
- src/utils/comma-query.utils.ts: parseCommaQuery() accepts string | string[] |
  undefined | null; splits on commas, trims each token, drops empty tokens, and
  deduplicates while preserving first-occurrence order.
- src/utils/test/comma-query.utils.test.ts: 18 tests covering null/undefined,
  empty/whitespace, single/multi value, trimming, deduplication, array input,
  and real-world multi-tag filter strings.

accesslayerorg#214 — Creator feed default page-size constant module
- src/constants/creator-feed-pagination.constants.ts: CREATOR_FEED_DEFAULT_PAGE_SIZE,
  CREATOR_FEED_MAX_PAGE_SIZE, CREATOR_FEED_MIN_PAGE_SIZE — feed-specific constants
  that evolve independently from the generic pagination policy.
- src/modules/creators/creators.limit.utils.ts: updated resolveCreatorListLimit()
  to import from the new feed constants module and add min/max clamping.

accesslayerorg#215 — Stable sort tie-breaker helper for creator lists
- src/utils/sort-tiebreaker.utils.ts: withTieBreaker<T>() builds a comparator
  using a primary key + ascending id tie-breaker; stableSortCreators() returns a
  sorted copy without mutating the input. Guarantees deterministic page output
  when primary keys are equal.
- src/utils/test/sort-tiebreaker.utils.test.ts: 12 tests covering asc/desc,
  tie-break direction, string/number keys, mutation safety, empty/single-item.

accesslayerorg#216 — Integration test for empty creator activity feed
- src/modules/activity/activity-feed-empty.integration.test.ts: 10 tests mocking
  fetchActivityFeed to return [[], 0]; asserts response envelope shape (items[],
  meta.total, meta.hasMore, meta.offset, meta.limit), status 200, creatorId filter
  forwarding, and 400 on invalid query params.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 27, 2026

@nonsobethel0-dev 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

@Chucks1093 Chucks1093 merged commit b8f727e into accesslayerorg:main Apr 27, 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

2 participants