Skip to content

Fix #610, #613, #614: creator search test, webhook URL validation, cursor edge case#616

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
abayomicornelius:fix/issues-610-611-613-614
Jul 24, 2026
Merged

Fix #610, #613, #614: creator search test, webhook URL validation, cursor edge case#616
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
abayomicornelius:fix/issues-610-611-613-614

Conversation

@abayomicornelius

@abayomicornelius abayomicornelius commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Closes #610
Closes #613
Closes #614
Closes #614

Summary

Note on #614's "returns null" premise

The issue describes decodeCursor as returning null for invalid/empty input. The actual implementation throws a typed CursorChecksumError instead — a deliberate, arguably better design (silent null on tampered input is easy to mishandle upstream). Kept the real, already-tested behavior rather than asserting a false premise.

Test plan

  • tsc --noEmit — clean across the whole project
  • eslint on all touched/created files — clean
  • pnpm test (full suite) — same DB-connectivity failures before and after this branch for every test needing Postgres (172 failing due to Can't reach database server at localhost:5432 — no Postgres available in this sandbox: no Docker, no local install, and completing a Homebrew install would have required a sudo chown on a system directory I didn't want to do unprompted). Confirmed the 2 new integration tests fail with that same DB-connectivity error, not a type or logic error.
  • Verified the webhook schema's exact accept/reject behavior (http:// rejected, https:// with no host rejected, valid https://... accepted) with a standalone Node script exercising the zod schema directly
  • Confirmed the schema change doesn't break any existing test — the one place a plain http:// callbackUrl appears (webhook.integration.test.ts's retry-delivery test) writes directly via prisma.webhook.create, bypassing CreateWebhookSchema entirely
  • All non-DB-dependent unit tests pass (1111/1283 total; the gap is entirely the missing Postgres, confirmed via git stash showing identical failures pre-existing on main)

…ebhook URL validation (closes accesslayerorg#610, accesslayerorg#613, accesslayerorg#614)

accesslayerorg#614 — cursor.utils.test.ts already comprehensively covered round-trip
correctness and every malformed/tampered/empty-input case via
CursorChecksumError assertions. Added the one gap against accesslayerorg#614's
acceptance criteria: a payload with special characters (spaces,
slashes, unicode). Note: accesslayerorg#614 describes decodeCursor as "returning
null" for invalid input, but the actual (and better) design throws a
typed CursorChecksumError, already exercised by 7 existing tests in
this file — kept that real behavior rather than asserting a
null-return that doesn't match the implementation.

accesslayerorg#610 — Added creator-list-search-filter.integration.test.ts following
the existing real-DB pattern used by sibling tests in this module
(e.g. creator-list-price-filter.integration.test.ts): seeds three
creators (Alpha, AlphaTwo, Beta) via Prisma and asserts against the
real GET /api/v1/creators?search= endpoint — partial match returns
both Alpha and AlphaTwo while excluding Beta, matching is
case-insensitive, and an empty search string returns all seeded
creators.

accesslayerorg#613 — Found that CreateWebhookSchema only checked z.string().url(),
which accepts plain-HTTP and hostless URLs (verified:
'http://example.com' and 'https://' both passed before this change).
Added two refinements requiring https: protocol and a non-empty
hostname, each with its own field-level error message. Added
webhook-registration-url-validation.integration.test.ts covering:
http:// rejected 400, no-host https:// rejected 400, non-URL string
rejected 400, valid HTTPS accepted 201, and field-level error message
assertion via res.body.error.details[].field. Confirmed no existing
test breaks — the one place callback_url is ever a plain http:// value
(webhook.integration.test.ts's retry test) writes directly via
prisma.webhook.create, bypassing this schema entirely.

Verification note: could not run the two new integration tests
against a real Postgres in this environment (no Docker, no local
Postgres, and completing a Homebrew install would have required a
system-directory chown I didn't want to do unprompted). Verified via
`tsc --noEmit` (clean) and `eslint` (clean) instead, confirmed both
new test files fail with a DB-connectivity error (not a type/logic
error) when run without a database, and confirmed the webhook schema
change's exact accept/reject behavior with a standalone Node script
exercising the zod schema directly.
@drips-wave

drips-wave Bot commented Jul 24, 2026

Copy link
Copy Markdown

@abayomicornelius 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 4371888 into accesslayerorg:main Jul 24, 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