Skip to content

Restore scoped reads of stored creator-post comments - #1062

Merged
sidneyswift merged 1 commit into
mainfrom
codex/stored-comments
Oct 20, 2026
Merged

sidneyswift merged 1 commit into
mainfrom
codex/stored-comments

Conversation

@sidneyswift

@sidneyswift sidneyswift commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Restore the existing documented GET /api/comments workflow for reading saved comments on a creator's linked posts. Authentication derives the caller, access is checked before content reads, and an optional stored-post UUID only narrows the authorized set. No scraping, provider work, writes or billing are added.

Returns the five documented comment fields with saved nulls, exact scoped totals and timestamp/ID ordering. Pagination defaults to 1/10 and caps page size at 100; ambiguous inputs and unsupported offsets fail locally. Responses disable shared caching and storage failures return bounded errors.

Access reuses direct/shared-organization/Recoup-admin roster checks, with endpoint-local self-creator and owning-organization-key reads. Existing artist mutation permissions are unchanged. Missing/denied targets both return 403. The original artist_account_id wire name is retained.

Validation: 85 focused route/auth/roster/fan/query cases pass (33 new), plus 14 existing published-document/semantic cases; full ESLint, owned-file Prettier and diff checks pass. Real Supabase SDK URL/range/count serialization is checked behind an HTTP stub. One additional existing fan-schema suite cannot load locally because the shared dependency cache lacks ajv. Repository typecheck reports existing diagnostics outside these added files; no diagnostics in the added files at the checked revision. Locked-install CI and independent review remain required.

Existing work: Mono #327 and original app #2023; the shipped fan-date alternative (#1057/#1058/#1061) remains intact. The closed provider-scrape PR #480 is a different operation. The verification note records the contract, response nullability companion and limits.

Do not merge until independent review and coordinator approval. Public documentation needs a companion for nullable saved fields, bounded pagination and 401/403/500 responses. This PR does not close the whole reconciliation ticket or prove a live customer weekly-report journey.

Refs recoupable/mono#327, recoupable/app#2023.


Summary by cubic

Restores the documented GET /api/comments endpoint for reading stored comments on a creator's linked posts, without scraping, writes, or billing. Caller identity comes only from authentication, access is checked before any content read, and the optional stored post_id narrows only the authorized set.

Behavior

  • Returns the five documented comment fields with saved nulls, post-scoped exact totals, and commented_at DESC, id DESC ordering.
  • Pagination defaults to 1/10, caps at 100; duplicate, unknown, or out-of-range inputs return 400.
  • Responses disable shared caching; lookup failures return a masked 500 instead of revealing details.

Access

  • Reuses existing roster checks and adds endpoint-local self-creator and owning-organization-key reads, leaving artist mutation permissions unchanged.
  • Missing and denied targets both return 403; the original artist_account_id wire name is retained.

Written for commit 543dbdb. Summary will update on new commits.

View guided diff Turn on auto-fix

@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 2:42pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

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: ede6ed65-b9c0-4c49-8d9f-328f5e7aa9e8
  • 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

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

Copy link
Copy Markdown
Contributor

Independent acceptance: PASS for the stored-comments source/synthetic contract at 543dbdb29077cc41b614d64655aed0dab642b61c, based on 52a2e218bffdea2b69c0f8a8ba075202b08754d0.

Separate Spec and Standards reviews covered all nine changed files with no material findings. I checked out the published commit in a clean isolated worktree and ran 21 independent HTTP cases through the real route, shared authentication/access logic, domain handler and query adapter, with synthetic credential/grant/account/Supabase transport boundaries.

The cases verify API-key/Bearer parity, denied artist/organization access, creator-self and owning-organization reads, missing targets, linked-post ownership rather than commenter identity, post narrowing, empty social sets, five-field nullable projections, fixed-dataset pagination/order, bounded errors and preflight. Three deliberate ownership/order faults in the earlier private copy caused assertion failures; those expressions are unchanged in this head. A missing-count case also failed against the earlier false-zero fallback and passes with the published correction.

Fresh exact-head snapshot: format, lint, compatibility, test and Vercel pass; Cubic completed neutral; CodeRabbit reports skipped/manual-review-required. No unresolved review threads.

This is not a live PostgREST/permission or customer weekly-report proof. Public nullable-field/pagination/error documentation still needs its companion publication. Do not close all of Mono327/App2023 or claim Gatsby comment coverage from these tests. No merge, deployment, customer read/write or provider operation performed in this lane; coordinator owns the release decision.

This branch was successfully deployed

1 active deployment
Preview — 543dbdb2 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