You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
P0 Signature fix: Add billing_cycle and tier fields to LicensePayloadData so client re-encodes all 7 fields matching the server's signed JSON. Without this, RSA signature verification always fails.
P1 License Settings UI: Show license status (color-coded), expiry date (or "Lifetime"), tier, and billing cycle in the licensed section. Add "Purchase License" link for unlicensed users.
P1 ProFeatureGate: Add "Purchase License" link for unlicensed overlay and "Renew License" link for expired overlay.
Changes
License.swift: Add billingCycle: String? and tier: String to LicensePayloadData with nil→null encoding. Add tier: String and billingCycle: String? to License struct. Update License.from().
Reviewing files that changed from the base of the PR and between a7d9a69 and b27811a.
📒 Files selected for processing (4)
TablePro/Models/Settings/License.swift
TablePro/Views/Components/ProFeatureGate.swift
TablePro/Views/Settings/LicenseSettingsView.swift
TableProTests/Models/LicenseTests.swift
📝 Walkthrough
Walkthrough
Added tier and billingCycle fields to the LicensePayloadData and License models with JSON encoding adjustments. Updated license settings and pro feature gate UI views to display the new tier, billing cycle, and expiration metadata. Extended test coverage to validate encoding behavior for the new fields.
Changes
Cohort / File(s)
Summary
License Model Updates TablePro/Models/Settings/License.swift
Added tier: String and billingCycle: String? fields to LicensePayloadData with proper CodingKeys mappings. Updated encode(to:) to emit billing_cycle as null when nil. Extended License model with corresponding properties and updated License.from(payload:signedPayload:machineId:) to populate them from payload data.
Added UI elements to display license tier, billing cycle, status, and expiration metadata in license settings view. Inserted external "Purchase License" and "Renew License" links pointing to https://tablepro.app in both expired and unlicensed states across views.
Test Coverage TableProTests/Models/LicenseTests.swift
Updated test fixtures to include tier field in LicensePayloadData and SignedLicensePayload. Added explicit billingCycle: nil assignments to payload data cases. Added two new encoding tests validating JSON output structure and null field handling.
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
🐰 New tiers and cycles bloom so bright,
Billing seasons now in sight!
License metadata flows with grace,
Links to shop in their rightful place,
Tests ensure all fields align—
A license system so divine! ✨
✨ Finishing Touches📝 Generate docstrings
Create stacked PR
Commit on current branch
🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch fix/license-system
📝 Coding Plan
Generate coding plan for human review comments
Comment @coderabbitai help to get the list of available commands and usage tips.
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
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.
Summary
billing_cycleandtierfields toLicensePayloadDataso client re-encodes all 7 fields matching the server's signed JSON. Without this, RSA signature verification always fails.Changes
License.swift: AddbillingCycle: String?andtier: StringtoLicensePayloadDatawith nil→null encoding. Addtier: StringandbillingCycle: String?toLicensestruct. UpdateLicense.from().LicenseSettingsView.swift: Add Status, Expires, Tier, Billing rows + purchase link.ProFeatureGate.swift: Add purchase/renew links to gate overlay.LicenseTests.swift: Update all test initializers, add 2 encoding tests.Backend (already pushed to licenseapp)
HandleOrderRefunded— suspend license on refundHandleSubscriptionCancelled— log only, letsubscription_expiredhandle expiryHandleSubscriptionPaymentSuccess— fix lifetime billing cycle bugTest plan
Summary by CodeRabbit
New Features
Tests