Repository navigation
Conversation
okapitula
requested review from
jakubfilinger-b,
klaudia-blazyczek-blurify,
marek-chmielowski-blurify,
mp-blurify and
zaxovaiko
as code owners
November 4, 2026 17:43
zaxovaiko
removed request for
jakubfilinger-b,
klaudia-blazyczek-blurify,
mp-blurify and
zaxovaiko
November 4, 2026 17:43
…kfill An empty rank, rakeback, rank-challenge or streak product list no longer means every product. Like races, each list must name known products, at least one, none repeated; the admin config saves refuse anything else. Migration 0022 drops the empty defaults, gives every empty list all four products so no live config changes what it counts, and adds a non-empty CHECK on all four columns. BREAKING CHANGE: rank and streak eligibleProducts accept only WagerProduct values and must be non-empty, and the rakeback and rank-challenge lists must be non-empty when sent. A save with [] or an unknown product returns 400.
okapitula
force-pushed
the
fix/eligible-products-one-rule
branch
from
November 5, 2026 11:49
b28208c to
2431798
Compare
jakubfilinger-b
requested changes
Nov 6, 2026
jakubfilinger-b
left a comment
Collaborator
There was a problem hiding this comment.
The new constraints need a rollout compatible with the previous API version.
An instance on the previous release still accepts an empty list. With the CHECKs in 0022 its save failed with a 500, and without the empty branch a list it saved after the backfill counted nothing. 0022 now only backfills and drops the defaults; the CHECKs and the empty-list branch go in a follow-up once the previous release has drained.
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.
Summary
WagerProductvalues, at least one, none repeated) validates races,PUT /backoffice/promo/ranks/configandPUT /backoffice/promo/streaks/config.0022_rank_streak_products_requireddrops the empty defaults on the rank and streak lists and gives every empty list all four products.WAGER_PRODUCTS, fixtures name their products, anddocs/modules/gamification.mdstates the rule.Why
Races already required an explicit list, while rank, rakeback, the rank challenge and the streak still read an empty one as "every product". That made two rules for the same setting, and an empty list silently counted products the operator never chose, sportsbook rakeback included. Now there is one rule for what a save accepts, with a backfill so no live config changes what it counts.
Alternatives considered
CHECKs and drop the empty-list branch now, as races' 0020 did. An instance still on the previous release accepts[]and would get a 500 from theCHECKmid-rollout. Dropping the empty-list branch now would make an empty list it saves after the backfill count nothing. So the database constraint and the runtime cleanup wait for a follow-up.Risks
eligibleProductsaccept onlyWagerProductvalues and must be non-empty. The rakeback and rank-challenge lists must be non-empty when sent. A downstream backoffice that sends[]or a free string gets a 400.['slots']) is kept and still counts nothing. The enum input refuses it, so the operator has to fix that list the next time they save the config.[]until it drains, and that list keeps counting every product. A follow-up release, shipped once no instance runs the previous one, backfills again, addsCHECK (cardinality(...) > 0)on the four columns, and drops the empty-list branch from rank, rakeback, streak and the rank challenge. Dropping the defaults is safe now: the previous contract already requireseligibleProducts, so its writers always send it.[]while the next one'sbeforeshows all four products. 0019 and 0020 did the same.0022_rank_periodic_margin) merges first.