Files

14 lines
1.8 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { VersionInfo } from '@start9labs/start-sdk'
export const v_0_2_52 = VersionInfo.of({
version: '0.2.52:0',
releaseNotes: {
en_US:
'Tier upgrade now carries Core leftover credits forward. Previously, a Core user with 6 of 6 lifetime credits remaining who activated a Pro license would see their balance flip to "50 / 50 (Pro)" — the 6 unused Core credits silently vanished because Core uses a lifetime counter and Pro uses a separate monthly counter. Now: on the first Core → paid-tier promotion (detected when tier_snapshot is still "core" and the resolved license tier is "pro" or "max"), the unused Core lifetime allotment (coreLifetimeCap lifetime_consumed) is transferred into purchased_balance — the same durable top-up bucket BTCPay credit purchases land in. The transferred credits never expire and stack on top of the new tier\'s monthly allotment, so total = monthly cap + carried-over Core credit + any prior top-up. Net effect for the typical upgrade path: a Core user who has used 0 of 6 lifetime credits and activates Pro now sees 56 total (50 Pro + 6 carried-over) instead of 50. The promotion handler is now centralized in a single `applyTierPromotion(row, newTier)` helper called from both `commitCredit` (the metered transcribe / analyze routes) AND `/relay/balance` (which Recap calls first after license activation to refresh the toolbar). Centralizing it fixes a pre-existing bug where a /relay/balance call between license activation and the first metered call could silently flip tier_snapshot to "pro", causing the subsequent commitCredit to skip the promotion logic entirely. The helper persists immediately when a promotion fires so the leftover transfer is durable across relay restarts.',
},
migrations: {
up: async ({ effects }) => {},
down: async ({ effects }) => {},
},
})