Repository navigation
feat: prepare premium subscriptions and casual hosting for coordinated launch - #67
Draft
NicholasBottone wants to merge 28 commits into
Draft
NicholasBottone wants to merge 28 commits into
NicholasBottone wants to merge 28 commits into
Conversation
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.
Adds premium casual hosting shared by the Django website and ranked bot. Django validates entitlements and reserves credits before launch, persists one usage entry on stop, and holds credits until Polar's dedicated meter reflects consumption. Lifecycle callbacks preserve terminal states across retries/out-of-order events and avoid SQLite writer races. Signed SDK events use wire aliases, checkout-return credentials are redacted, and positive sub-second ready sessions receive the five-minute minimum while never-ready sessions remain uncharged.
Validation: 47 website tests pass locally and on Linux, including real Django/Fastify contracts, concurrent SQLite regressions, and both sub-second/never-ready billing cases. Real sandbox acceptance covers checkout, usage debit/outage retry, cancellation/revocation, fixed-price upgrade/scheduled downgrade, standalone renewal without rollover, failed renewal/past-due launch denial, actual Discord role removal, and automatic payment/access/role recovery. A real patched 0.637-second session charged five credits once, with provider and website balances both 1,495 after a duplicate stop.
A fresh October 30 production SQLite snapshot migrated successfully on a disposable copy: all modeled columns present, zero foreign-key violations, and existing data preserved exactly across 22 application tables. Production was opened read-only and was not migrated.
Coordinated with xRCRankedBot #85 and xRCServerOrchestrator #18. Keep draft and unmerged: website main pushes deploy automatically. Remaining acceptance requires real-client joins/player-chat-score-OPR checks and a complete ranked queue-to-ELO series with inactivity/restart/resource cleanup and actual-player IP scoping. Production preparation also requires selecting/validating the game host, switching the Namecheap app from Python 3.9 to its available 3.12 runtime at authorized cutover, configuring fixed $5/$12 plans and production Polar IDs/secrets, and installing recurring workers. Polar's observed fifteen-minute recurring-order delay temporarily leaves zero credits before payment/grant processing.
See current acceptance evidence, ordered remaining tests, and the release checklist. No merge or production deployment is authorized.