fix: comma query parser, feed pagination constants, sort tie-breaker, empty feed test (#212-216)#221
Merged
Chucks1093 merged 1 commit intoApr 27, 2026
Conversation
… 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.
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #212
Fixes #214
Fixes #215
Fixes #216
What changed
#212 — Shared helper for parsing comma-separated query values
src/utils/comma-query.utils.ts—parseCommaQuery()acceptsstring | 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.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 policysrc/modules/creators/creators.limit.utils.ts— updatedresolveCreatorListLimit()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.ts—withTieBreaker<T>()builds a comparator with primary key + ascendingidtie-breaker;stableSortCreators()returns a sorted copy without mutating the input. Guarantees deterministic page output when primary keys are equalsrc/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 mockedfetchActivityFeed([[], 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 paramsHow to test
npm test