Skip to content

Verify published fan comment dates against the authorized response - #1058

Merged
sidneyswift merged 2 commits into
mainfrom
codex/fan-recency-doc-fixture
Oct 20, 2026
Merged

sidneyswift merged 2 commits into
mainfrom
codex/fan-recency-doc-fixture

Conversation

@sswiftdrtv

@sswiftdrtv sswiftdrtv commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

The new fan last_comment_at response needs a public schema/example that preserves unknown dates. This documentation companion freezes Marketing's resolved ArtistFans schema and synthetic known/unknown example, and adds four tests against the actual GET route and real validation/projection with mocked access/storage. Matching comment dates survive, missing/mismatched evidence remains null, object/array joins work, and invalid numeric dates fail the published schema.

API #1057 already implements the response. This PR changes only the shared documentation fixture and its tests; runtime behavior is unchanged. The public property remains optional nullable string/date-time. The matching Marketing PR follows this source; after its actual merge, retained Docs will be generated separately. This supports Last heard without restoring GET /api/comments, returning comment bodies or claiming exhaustive/live history. Tracks recoupable/mono#327 and recoupable/app#2023.

Validation: all 77 fan/contract tests across 14 files pass; the four new checks fail before the fixture correction. Response-constructor type check, scoped ESLint, formatting and whitespace pass. The new route cases keep real validation/projection while mocking authentication/storage; existing fans access-denial tests also pass. No customer comment read, live provider call, charge, write, migration or manual deployment.

Current companion head: eb439132 (the optional-property assertion also typechecks with the inferred JSON fixture). Full repository TypeScript does not pass: diagnostics remain outside the changed contract test; no diagnostic names the changed test. The focused response-constructor type check passes. Marketing #197 supplies the matching maintained source and currently pins this review head; refresh it to the actual API merge before release.

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Oct 20, 2026 7:30am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T07:28:58.767270Z 8208f74 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: recoupable/api/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ba4181f8-356a-4308-ae8d-a85daaccbf46

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: recoupable/api/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7625fef7-4f4b-4025-bb1a-65606e1a2cf8
📥 Commits

Reviewing files that changed from the base of the PR and between e51d4ed and 8208f74.

⛔ Files ignored due to path filters: 1
  • lib/contracts/__tests__/publishedFanRecency.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing: 1
  • lib/contracts/fixtures/published-docs.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The published docs fixture adds an artistFans success-response contract with fan records, pagination, and examples. It also updates the recorded hash for releases.json.

Changes: Published docs contract

Layer / File(s) Summary
Artist fans response contract
lib/contracts/fixtures/published-docs.json
The fixture adds the artistFans success-response schema, including nullable last_comment_at, pagination metadata, and known and unknown comment-evidence examples. It also updates the recorded releases.json hash.

Priority: ⚪ Pending latest changes

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: sidneyswift

Merge Risk: ⚪ Minimal · up to 8208f

The published fixture has no identified issue requiring correction before merge.

Pre-merge checks: Passed 2 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Solid & Clean Code Warning The new it.each callback in lib/contracts/__tests__/publishedFanRecency.test.ts:49-89 spans 41 lines. It prepares mocked data, invokes the route, parses the response, validates the schema, and che… Refactor the 41-line test callback into smaller focused test steps or helpers. Keep each function at 20 lines or fewer, with separate responsibilities for mock setup, route invocation, schema validation, and interaction assertions. Place an…
Passed Passed checks: 2 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Solid & Clean Code

Explanation

The new it.each callback in lib/contracts/__tests__/publishedFanRecency.test.ts:49-89 spans 41 lines. It prepares mocked data, invokes the route, parses the response, validates the schema, and checks calls. This exceeds the custom check's 20-line function limit and combines several responsibilities. The pull request adds this function in a new file, so the issue is introduced by the pull request.

Resolution

Refactor the 41-line test callback into smaller focused test steps or helpers. Keep each function at 20 lines or fewer, with separate responsibilities for mock setup, route invocation, schema validation, and interaction assertions. Place any new named primary function in a file with the matching function name.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Fan records arrive in rows
Pages mark the steady flow
Known and unknown comments show
Null timestamps have room to go
The fixture keeps its hash in tow

Comment @coderabbitai help to get the list of available commands.

This branch was successfully deployed

1 active deployment
Preview — eb439132 Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants