Merged
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Graceful handling of old include by default products. Though we dont support it anymore someone may query txns with it. After the txn table rework this will probably not matter.
7314e16 to
f9526e6
Compare
Collaborator
Author
|
@greptileai refresh summary |
Collaborator
Author
|
@greptileai refresh summary |
Old subscriptions may not have canceledAt, and old callers may still be expecting null for inline products
2c40f59 to
1fcb08a
Compare
This is temporary, we defer fixing up verify data integrity payments to the future
Its better to manage this outside prisma, it gives us more flexibility
N2D4
approved these changes
Apr 17, 2026
Contributor
|
Promptless prepared a documentation update related to this change. Triggered by PR #1315 Documented item grants and expiration behavior in payments, including the ledger algorithm that consumes credits from soonest-expiring grants first, plus a changelog entry. |
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.
Object of this PR
This PR is NOT a monolithic series of fixes for the payments suite + a complete rework. Its aims were
a) introducing and robustly testing the bulldozer db system
b) reworking the payments underlying architecture to use bulldozer for correctness and scalability
c) Achieving parity with the old payments system excepting a few changes like ensuring correctness of the ledger algo
There may still be some work to do with handling refunds, decoupling the concepts of purchases from that of products, and some other things.
Ledger Algorithm
This has been tuned and fixed. Item removals i.e negative item quantity changes will apply to the soonest expiring item grant i.e positive item quantity change. This is what is best for the user. Item grants can also expire, and when they expire we obviate whatever is left of their original capacity (meaning after all the removals that were applied to it). Our ledger algo is applied via Bulldozer, so automatic re-computation is handled when a new grant/ removal is inserted in the middle of the existing ones.
Things we got rid of
Summary by CodeRabbit
New Features
Bug Fixes
Chores