-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: billing metrics display for pro users #450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: billing metrics display for pro users #450
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | aa25b37 | Oct 03 2025, 07:58 AM |
How to use the Graphite Merge QueueAdd the label Main to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code Review: Fix billing metrics display for pro usersSummaryThis PR addresses the display issue where Pro users were seeing "0/0" for memory metrics. The changes correctly implement "Unlimited" display for Pro users while maintaining the progress bar for Free users. Positive Aspects
Issues and Concerns1. Logic Issue in profile.tsx:210-214There is a conditional inside the progress bar that will never execute. The code checks isPro inside a block that is wrapped with {!isPro && ...} at line 206, so isPro will always be false inside this block. The isPro check for bg-green-500 is unreachable dead code. Recommendation: Simplify the className to only check memoriesUsed >= memoriesLimit for red vs blue. Location: apps/web/components/views/profile.tsx:210-214 2. Inconsistent Import Pathsbilling.tsx uses @ui/components/button while profile.tsx uses @repo/ui/components/button. Consider standardizing import paths across components. Testing ConsiderationsTest scenarios to verify:
PerformanceNo performance concerns. The changes are purely presentational. SecurityNo security concerns identified. Suggestions for Future Enhancement
Overall AssessmentApproved with minor suggestions. The core fix works well and solves the reported issue. The dead code issue in profile.tsx:210-214 should be cleaned up, but it does not affect functionality since that code path is unreachable. Recommendation: Merge after removing the unreachable isPro check in the progress bar styling. |
Merge activity
|
Code Review: Fix billing metrics display for pro users✅ Positive Changes1. Correct Business Logic 2. Consistent Implementation 3. Clean Conditional Rendering 🐛 Potential Issues1. Missing Update in <span className="text-sm text-foreground">
{memoriesUsed} / {memoriesLimit}
</span>This should also display "Unlimited" for consistency. The progress bar was removed (good), but the text still shows the numeric limit. Suggested fix: <span className="text-sm text-foreground">
Unlimited
</span>2. Inconsistent Logic in {!isPro && (
<div className="w-full bg-muted-foreground/50 rounded-full h-2">
<div
className={`h-2 rounded-full transition-all ${
memoriesUsed >= memoriesLimit
? "bg-red-500"
: isPro // ← This condition will always be false here
? "bg-green-500"
: "bg-blue-500"
}`}Since this is inside Suggested fix: {!isPro && (
<div className="w-full bg-muted-foreground/50 rounded-full h-2">
<div
className={`h-2 rounded-full transition-all ${
memoriesUsed >= memoriesLimit ? "bg-red-500" : "bg-blue-500"
}`}3. Division by Zero Risk While this is now avoided by removing the progress bar, it's worth noting for the remaining instance in 🎨 Code QualityFormatting: ✅ Good - The code follows the project's Biome formatting standards 🧪 Test CoverageMissing: No test coverage for this change. Consider adding tests for:
📊 PerformanceNo performance concerns - the changes are simple conditional renders. 🔒 SecurityNo security concerns identified. 📝 SummaryThe PR successfully fixes the
Recommendation: Address issue #1 before merging, as it means the bug is only partially fixed. Issue #2 is a minor cleanup that can be done now or later. |
Before we are showing 0/0 
4823d1f to
aa25b37
Compare
Pull Request Review: Fix billing metrics display for pro usersSummaryThis PR successfully addresses the issue where Pro users were seeing "0/0" for their memory usage. The fix appropriately displays "Unlimited" for Pro users while maintaining the existing usage display for Free users. ✅ Positive Aspects
🐛 Potential IssuesCritical: Redundant Code in profile.tsx (line 212-214)className={`h-2 rounded-full transition-all ${
memoriesUsed >= memoriesLimit
? "bg-red-500"
: isPro
? "bg-green-500" // ⚠️ This condition is unreachable
: "bg-blue-500"
}`}Issue: The progress bar is only rendered when Fix: Remove the redundant check: className={`h-2 rounded-full transition-all ${
memoriesUsed >= memoriesLimit ? "bg-red-500" : "bg-blue-500"
}`}Location: 🎯 Code Quality Improvements1. Type Safety (apps/web/components/views/profile.tsx:33-38)Consider adding explicit types for the feature check data: type MemoriesFeature = {
usage: number;
included_usage: number;
} | undefined;
const { data: memoriesCheck }: { data: MemoriesFeature } = fetchMemoriesFeature(
autumn,
!isCheckingStatus && !autumn.isLoading,
);2. Magic Numbers (apps/web/components/views/billing.tsx:129)The connection limit const CONNECTIONS_LIMIT = 10;
// or fetch from connectionsCheck?.included_usage if available⚡ Performance ConsiderationsNo performance concerns identified. The changes are purely presentational with minimal runtime impact. 🔒 Security ConcernsNo security issues identified. The changes don't introduce any new attack vectors. 🧪 Test CoverageMissing: No tests found for these components. Recommendation: Add unit tests to verify:
Example test structure: describe('ProfileView', () => {
it('shows unlimited for pro users', () => {
// Mock isPro = true
// Assert "Unlimited" is rendered
// Assert progress bar is not rendered
});
it('shows usage metrics for free users', () => {
// Mock isPro = false, usage data
// Assert "X / Y" format is rendered
// Assert progress bar is rendered
});
});📝 Additional Observations
✅ RecommendationApprove with minor fixes requested The PR solves the stated problem effectively. However, please address the redundant isPro check in profile.tsx:209-214 before merging, as it creates confusion and technical debt. 📋 Action Items
|


Before we are showing 0/0