Repository navigation
Conversation
A market description with outcome_type set (Anytime Goalscorer: outcome_type="player", empty <outcomes/>) lists no static outcomes on purpose: its outcomes are player URNs that arrive with the odds and OutcomeName already resolves them through the player cache. The coverage check treated every zero-outcome entry as incomplete, so MarketDescriptionByID answered ErrMarketLocaleIncomplete and the bulk view omitted the market; consumers could never read its description. A zero-outcome entry now counts as covered when the row declares an outcome_type, both in coversLocaleLocked and in removeLocale's emptiness test, and a dynamic row that omits the <outcomes> block entirely is read as empty rather than malformed. Rows without outcome_type keep the old classification.
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
Contributor
Author
|
Opened against the wrong repository: kollector consumes github.com/corwyn-com/gosdk. Superseded by the same change in corwyn-com/gosdk. |
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.
What was wrong
The odds feed now publishes markets whose outcomes are not in the catalog. Anytime Goalscorer (market 341 on test) is described as
and its outcomes arrive with the odds as
cw:player:*URNs. The SDK is already half-ready for that:marketDataImpl.OutcomeNametakes the dynamic branch whenoutcome_typeis set and resolves the name through the player cache. The market description cache was not:coversLocaleLockedtreats an entry with zero outcomes as covering nothing (guarding against a broken row whose<outcomes>container lost its children), soMarketDescriptionByIDansweredErrMarketLocaleIncompleteandLocalizedMarketDescriptionsomitted the market. A consumer could never read the description, and on kollector everyodds_changefor market 341 is skipped with "market description unavailable" (~260 times per 10 minutes on test since the market went live).What changes
coversLocaleLocked: a zero-outcome entry counts as covered when the row declares anoutcome_type(dynamicOutcomesLocked). The name check and the per-outcome name check are unchanged.removeLocale: same exception in the emptiness test, so reconciliation does not drop a dynamic market that legitimately has no outcomes.upsert: a dynamic row that omits the<outcomes>block entirely is read as an empty container instead of being recorded as malformed. Rows withoutoutcome_typekeep the old classification, includingTestMarketDescriptionCache_EmptyOutcomesContainerNotCovered.No public API change.
Tests
internal/cache/market_dynamic_outcomes_test.go:outcome_type="player"with<outcomes/>and with no outcomes block: by-id lookup succeeds, snapshot carries the name,OutcomeType,IncludesOutcomesOfTypeand zero outcomes, the bulk view lists the market.<outcomes/>withoutoutcome_typestill answersErrMarketLocaleIncomplete.Consumer: corwyn-com/kollector needs this in a release to finish GAD-5544 (dynamic player outcomes in mq).