fix: exclude archived products from check preview and related flows#796
Open
lutz-grex wants to merge 1 commit intouseautumn:devfrom
Open
fix: exclude archived products from check preview and related flows#796lutz-grex wants to merge 1 commit intouseautumn:devfrom
lutz-grex wants to merge 1 commit intouseautumn:devfrom
Conversation
- ProductService.getByFeature: filter out archived products so they never appear in /check withPreview response (paywall dialog bug) - handleGetPricingTable: pass archived: false so archived products are excluded from the customer-facing pricing table component - getCusAndProducts: reject attach requests that target an archived product with a clear error message - createProduct / handleCreatePlan: allow reusing an archived product's ID for a new product (don't treat archived as a conflict)
|
@lutz-grex is attempting to deploy a commit to the Autumn Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
ProductService.getByFeature: Addedne(products.archived, true)to the query so archived products are never included in the/checkwithPreviewresponse. This was the root cause of paywall dialogs incorrectly suggesting upgrades to retired/archived plans as the upgrade target.handleGetPricingTable: Passarchived: falsetolistFullso archived products are excluded from the customer-facing pricing table component.getCusAndProducts: Reject attach requests that target an archived product with a clear error message, preventing archived products from being attached to customers.createProduct/handleCreatePlan: Allow reusing an archived product's ID for a new product — don't treat an archived product as a conflict when checking for duplicate IDs.Related Issues
No existing issue - bug found during code review
Type of Change
Checklist
Screenshots (if applicable)
Additional Context
Other
ProductServicemethods (listDefault,handleListPlans,handleListBillingPlans) already filtered archived products correctly usingne(products.archived, true)orarchived: false. This PR brings the remaining callers in line with that existing pattern -getByFeaturewas the only query method missing the filter entirely, and the other three fixes address the downstream consequences of archived products leaking through.Summary by cubic
Archived products are now fully excluded from previews and customer-facing flows to prevent upgrade prompts to retired plans and invalid attachments. Creating new products can reuse IDs from archived products.
Written for commit 3f5d01b. Summary will update on new commits.
Greptile Summary
This PR systematically excludes archived products from customer-facing flows to prevent upgrade prompts to retired plans.
Bug Fixes
/checkendpoint'swithPreviewresponse incorrectly suggesting upgrades to archived/retired products by adding archived filter toProductService.getByFeatureat server/src/internal/products/ProductService.ts:67Improvements
createProductandhandleCreatePlanto only reject non-archived duplicatesThe changes are consistent with existing patterns throughout the codebase. Other
ProductServicemethods (listDefault,handleListBillingPlans) already filter archived products using the same approach. The fix bringsgetByFeaturein line with these existing patterns.Confidence Score: 5/5
ne(products.archived, true)andarchived: falseis consistent with existing code inlistDefault,handleListBillingPlans, and other methods. The validation logic is defensive and prevents potential runtime errors. The changes are minimal, focused, and directly address the stated bug.Important Files Changed
ne(products.archived, true)filter togetByFeaturemethod to exclude archived products from check preview resultsarchived: falseparameter tolistFullcall to exclude archived products from customer-facing pricing tableLast reviewed commit: 3f5d01b
(4/5) You can add custom instructions or style guidelines for the agent here!