Repository navigation
0.1.8: Lock down the example app and fix README drift - #80
Open
michaelshimeles wants to merge 1 commit into
Open
michaelshimeles wants to merge 1 commit into
michaelshimeles wants to merge 1 commit into
Conversation
- Remove the example's unauthenticated linkSubscriptionToOrg mutation, which let any caller set userId on any subscription and then pass the ownership checks in cancelSubscription and updateSeats. Also remove getCustomerData, getSubscriptionInfo, and getOrgPayments, which the app never used and which returned billing data without checking the caller. - getOrgSubscription and getOrgInvoices require sign-in and only return billing the caller purchased, since the demo has no org membership. - Export vCustomer, vSubscription, vCheckoutSession, vPayment, and vInvoice. The example's hand-written returns validators were missing cancelAt, so a subscription scheduled to cancel failed validation. - The portal action looks up the user's customer directly, and the team checkout uses getAppUrl() for its cancel URL. - README: drop payment_intent.payment_failed (never handled), describe invoice.payment_failed accurately, list every public query and mutation, add missing schema fields, fix the clone URL, and run Prettier over the file. Co-authored-by: Cursor <cursoragent@cursor.com>
commit: |
michaelshimeles
marked this pull request as ready for review
November 3, 2026 22:01
This branch has not been deployed
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.
Third of five stacked PRs, and the last one in the 0.1.8 patch. Based on the customer lookups PR.
What changed
linkSubscriptionToOrgwas a public mutation with no auth check. Any caller could setuserIdon any subscription, which then passed the ownership checks incancelSubscription,reactivateSubscription, andupdateSeats, so they could cancel someone else's subscription. It's removed, along withgetCustomerData,getSubscriptionInfo, andgetOrgPayments, which the app never called and which returned billing data for any ID.getOrgSubscriptionandgetOrgInvoicesnow require sign-in and only return billing the signed-in user bought. The demo has no org membership to check against, and a comment says to check membership in a real app.vCustomer,vSubscription,vCheckoutSession,vPayment, andvInvoice. The example's hand-writtenreturnsvalidators were missingcancelAt, so any subscription scheduled to cancel failed validation at runtime. The example uses the exported validators now.getAppUrl()for its cancel URL.payment_intent.payment_failedis no longer listed as handled, since it never was.invoice.payment_failedis described accurately.main, which is most of the line count here.Testing
npm run build,npm test(63 passing),npm run typecheck(covers the example app),npm run lint.npx convex dev --onceagainst a local anonymous deployment deploys the example and the component cleanly.