[codex] Harden demo read paths#3
Conversation
…bound feed - seed:run is now internalMutation (was a public wipe-the-DB endpoint) - setProfileBySubject -> updateProfile: identity from ctx.auth, no client role escalation; users.list no longer exposes auth subjects - delete dead unauthenticated endpoints: reads.ts, posts.create, posts.counts - bound posts.feed to 200 most recent (was unbounded collect + N+1 reads) - add posts.orgId and fix feedForSpace org-visibility filter (checked a field that did not exist; org posts were invisible to everyone) - dedupe session-overlay participants (duplicate avatars / React keys) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
38 verified audit findings (tokens, components, architecture, routes, docs) organized into 7 executable phases with per-step do/verify instructions for an autonomous agent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
There was a problem hiding this comment.
1 issue found across 9 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Summary
This PR hardens the demo data path after the docs/analytics cleanup landed on
main.The app is still a flow-design prototype with a shared Convex demo database. Public write mutations made it possible for visitors to persist demo state changes into that shared backend, while the frontend already has a session-only overlay for visitor interactions. This change aligns the backend with that model: shared demo data remains read-only for visitors, and temporary interaction state stays local to the browser session.
What changed
internalMutationso it is not callable as a public function.subjectvalues from the public user directory response.updateProfilemutation based onctx.auth.getUserIdentity().orgIdto posts and simplifies org-scoped shared-space visibility checks.CLEANUP_PLAN.mdas the next-phase cleanup and architecture handoff.User impact
Visitors can still explore the product flow, create local session posts/replies, mark content read, and use the prototype without mutating shared demo data. Authenticated profile edits are safer because the caller can only edit the profile associated with their own identity.
Validation
origin/mainafter PR Clean docs and add Plausible tracking #2 merged.bun installto hydrate the newly merged Plausible dependency locally.bun run buildsuccessfully.Summary by cubic
Locks down the demo backend to keep shared data read‑only, bounds feed reads, fixes org‑scoped visibility, and migrates auth to stable
tokenIdentifierwith automatic backfill from legacysubject(now via a shared helper).Bug Fixes & Hardening
convex/reads.ts,posts.create,posts.counts); visitor posts/replies/read state stay in the session overlay.seed.runaninternalMutationto prevent public DB wipes.users.updateProfile(usesctx.auth.getUserIdentity(); no role edits);users.listno longer returnstokenIdentifierorsubject.users.by_token_identifierindex and switched lookups; extractedauthUsers.findUserForIdentityto resolve/backfill identities, used inusers.updateProfileanddiscussionsviewer creation;discussionsnow storestokenIdentifierand derives avatar color from it.posts.orgIdand fixed org‑scoped visibility inspaces.feedForSpace.posts.feedto the latest 200 items.convex/_generated/api.d.ts(addedauthUsers, removedreads) and addedCLEANUP_PLAN.md.Migration
users.updateProfile.convex/_generated/with codegen when a deployment is available.Written for commit b466066. Summary will update on new commits.