Repository navigation
Description
Component
Helpers
Problem or Use Case
Game client 0.41.2115745 changed the game data constants that the helpers mirror. Once a Comlink release is built on that schema, the library will be out of step with it:
- New game data bit.
GameDataItemsEnumgainsOvercharge = 4503599627370496(252). It selects three new collections:overchargeDefinition,overchargeStatGroupandoverchargePointMissionLookup.DataItemshas no member for it, so these collections can only be requested withDataItems.ALLor a raw integer. SEGMENT4moves. The game folds the new bit into segment 4:Segment4goes from3377424842620928to7881024469991424.DataItems.SEGMENT4andConstants.Segment4would then return less thanrequest_segment=4does.- New enum members missing from the snapshot tables:
UnitStat62UNITSTATCRITICALDAMAGENEGATE, shown in game as "Critical Defense" (UNIT_STAT_CRITICAL_DAMAGE_NEGATEin the localization bundle). Not inSTATSorUNIT_STAT_ENUMS_MAP.ItemType36OVERCHARGE_POINT. Not inITEM_TYPES.CurrencyType51ARENA_CURRENCY, "Arena Tokens" (SHARED_CURRENCY_ARENA). Not inCURRENCY_TYPESorCURRENCY_NAMES, soItemNamescan't name it without the liveget_enums()table.
Why this has to wait. The current public Comlink release (spec 0.40.5) is still on the 0.40 schema. It validates items as an integer string from 1 to 4503599627370495 (252 − 1), or -1. Checked against it on 2026-11-04:
| Request | Result on Comlink 0.40.5 |
|---|---|
items=4503599627370496 (Overcharge) |
HTTP 400 |
items=7881024469991424 (new SEGMENT4) |
HTTP 400 |
items=3377424842620928 (current SEGMENT4) |
200, same collections as request_segment=4 |
items=-1 (DataItems.ALL) |
200 |
Shipping the new SEGMENT4 now would turn every DataItems.SEGMENT4 request into an HTTP 400 for users on that release.
Proposed Solution
When a Comlink release built on the 0.41 schema is published:
Library changes (all in src/swgoh_comlink/helpers/)
_data_items.py: addOVERCHARGE = 4503599627370496, plus the aliasesOVERCHARGE_DEFINITION,OVERCHARGE_STAT_GROUPandOVERCHARGE_POINT_MISSION_LOOKUP(same bit). SetSEGMENT4 = 7881024469991424. Raise the documenteditemsrange to 253 − 1. On Python 3.15+,int(DataItems.ALL)becomes 253 − 1; the wire value stays-1._constants.py:Segment4 = 7881024469991424, and map the legacy name"Overcharge"toOVERCHARGEsoConstants.get("Overcharge")resolves._stat_data.py: add stat"62"(nameKeyUNIT_STAT_CRITICAL_DAMAGE_NEGATE, descKeyUNIT_STAT_DESCRIPTION_CRITICAL_DAMAGE_NEGATE, enumUNITSTATCRITICALDAMAGENEGATE, tableKeyCRITICAL_DAMAGE_NEGATE). Add36: "OVERCHARGE_POINT"toITEM_TYPES,51: "ARENA_CURRENCY"toCURRENCY_TYPES, and"ARENA_CURRENCY": "Arena Tokens"toCURRENCY_NAMES. Update the snapshot docstrings to name the new schema version.
Tests and docs
- Refresh
tests/resources/enums-item-currency.jsonfrom the new release'sget_enums(), sotest_snapshots_match_recorded_get_enumschecks the new members. - Update the
Constantstests: segment values, theOverchargelegacy name, the overcharge aliases sharing one bit, and the stat 62 entry. docs/migration.md: the newSEGMENT4value, the 253 − 1 range, and a note on theOverchargebit.
Verify against the new public release before merging
/openapi.jsonreports a version newer than 0.40.5, andget_enums()["GameDataItemsEnum"]listsOverchargeandSegment4 = 7881024469991424.get_game_data(items=DataItems.OVERCHARGE)returns 200 with the threeovercharge*keys.get_game_data(items=DataItems.SEGMENT4)returns the same populated collections asrequest_segment=4.- Read the new
itemsbound from the 400 message foritems=9007199254740992(253). If the release still rejects out-of-range values, put the HTTP 400 sentence back in theDataItemsdocstring with the new bound. get_enums()listsUnitStat62,ItemType36 andCurrencyType51 under the names above.- Run
examples/Sync/get_game_data.pyandexamples/Async/get_game_data.pyagainst it. uv run pytest,uv run ruff check src testsanduv run ty checkall pass.
Out of scope here: helpers over the new Era Arena and Overcharge data (eraDefinition.eraArena, eraDefinition.overchargeConfig, the overcharge* collections). On game data 0.40.6 these are null or empty, so there is nothing to build or test against yet.
Alternatives Considered
- Ship the enum table additions now and hold only the
DataItemschange. The stat, item type and currency entries are harmless on 0.40.5. But the snapshot tables are meant to match one recordedget_enums()response, and no public release returns these members yet. Shipping everything together keeps the snapshots, the fixture andDataItemson the same schema version. - Add
OVERCHARGEnow as an opt-in member, keeping the oldSEGMENT4. This avoids breakingSEGMENT4, but it exposes a member that every current public release rejects with HTTP 400. - Compute
SEGMENT4from the liveget_enums()at runtime. This would follow the server automatically, but it costs a request and makesDataItemsdepend on a client. The enum is a staticIntFlagon purpose.
Activity
github-actions commentedon Nov 23, 2026
Addressed by #273, which is now merged into
develop. This issue will close automatically when that change is released tomain.