Repository navigation
Store a trial that has already ended as expired, not active - #1483
Merged
Merged
Conversation
helpcodeai
enabled auto-merge (squash)
November 3, 2026 12:21
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
The licence site grants one trial per email address. When the same address asks again, for example from a second workspace, the site returns the old trial even if it has already ended.
requestTrialLicensestored that trial asactive, and the licence page said "Trial activated successfully". Then the workspace stayed blocked, and the row stayedactiveuntil the hourly cron marked it expired.Seen on Cloud on 2026-11-02 at 17:24 UTC.
Changes
requestTrialLicensestores a returned trial whoseexpiresAtis in the past asexpired. The guard then shows "trial ended" with the plans, and the repair cron does not ask for that workspace again, because it now holds a licence.TrialAlreadyEndedError: "The free trial for this email has already ended. Choose a plan to continue." The licence page's Start trial button shows this message instead of a false success. Email verification and social sign-up only log it, as before for any trial failure.Cloud and self-hosted: both use this path. The only change is for a trial that has already ended.
Type
Testing
license-trial.service.spec.ts: an ended trial is stored as expired and throws, and is not set as the instance key; a running trial is still active)In
packages/backend, afternpx prisma generate:npx jest --maxWorkers=4 src/license: 14 suites, 241 tests passed.npx jest --maxWorkers=4 src/auth: 30 suites, 470 tests passed.npx eslinton the two changed files: clean.npx tsc --noEmit -p tsconfig.json: no errors in the changed files. The only errors were in File Search modules (picomatch,@aws-sdk/client-s3,basic-ftp,ssh2), because the local node_modules came from an older checkout. CI runs the full check.Checklist