feat(ads): VK post-move interstitial + retire deprecated hint_balance/paid_account #229
Reference in New Issue
Block a user
Delete Branch "feature/ads-interstitial"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Interstitial ads (VK)
Post-move fullscreen interstitial, VK-only, client-mirrored gate:
adsForputs the config cooldowns (global 5m / vs_ai 30m / hint 1m) and asuppressedflag onProfile.ads.suppressedis the same no-ads /no_bannergate as the banner, resolved server-side; fail-safe suppressed on a read error.maybeShowInterstitialself-gates on a per-kind last-shown time inlocalStorage, showing a VK interstitial (vkShowInterstitial) after a confirmed play or a hint only — never a pass / exchange / resign. Offline → banner only. The contourVITE_ADS_STUBswaps the "ad fired" toast for the real ad (prod always real).Retire deprecated hint_balance / paid_account (expand-contract, code only)
The
accounts.hint_balance/paid_accountcolumns are no longer read or written by the domain (owner: unused in prod, an MVP leftover). Removed: theAccountfields + scan, the deadaccount.SpendHint,account.GrantHints, and the admin grant-hints action (route + form + DTO). The in-game hint display now comes wholly from the payments hint benefit (HintsAvailable); banner eligibility and account merge no longer read the legacy flags. The columns stay (no migration → an image rollback is DB-safe); a later contract-PR does theDROP.Tests
ads.test.ts(the client-mirrored gate — absent/suppressed/offline/non-VK/per-kind cooldown/vs_ai/stub), codec ads round-trip.no_banner); a gateway ads transcode test (the encode is not exercised by the mock e2e).Docs
PAYMENTS §10 (+ru) interstitial nuances, the decision amends, backend README, the plan.
Cooldowns were tracked per kind ({move,hint}), so a hint ad and a move ad did not see each other: after a hinted move's ad the move timer was still zero, and the next plain move fired an ad immediately — two ads within a minute, under the cooldown. Track a single shared last-shown time; the kind only selects the required gap (hint 1m, move 5m, vs_ai 30m) measured from the last interstitial of any kind. A hint can still fire on its shorter gap (D30's "independent" hint cooldown), but never stacks a second ad within a cooldown. Tests: a hint uses the shorter shared gap; a move does not stack onto a just-shown hint ad.New commits pushed, approval review dismissed automatically according to repository settings