testsAndMisc/docs/superpowers/evidence/steam-library-hide-fix-2026-05-17.json
Krzysztof kuhy Rudnicki 61a9e5dc3c steam_backlog_enforcer: fix library_hider crash on invalid AppIDs + improve HLTB hour extraction
- library_hider.py: add safeHide(ids) JS helper that binary-bisects on failure
  to skip problematic DLC/tool IDs without blocking the entire hide pass
- library_hider.py: increase CDP timeout 30s -> 120s; extract richer CDP error
  details from exceptionDetails/exception.description
- _hltb_detail.py: rewrite _extract_base_leisure_hours() to pick the maximum
  (slowest) time across all platform comp_high values and *_h fields; add
  _platform_comp_high_candidates() helper
2026-05-22 15:59:18 +02:00

38 lines
2.0 KiB
JSON

{
"intent": "Fix RuntimeError 'JS evaluation error: Unknown JS error' when hide_other_games() is called with owned game IDs that include invalid AppIDs (DLC/tools returned by Steam API include_played_free_games).",
"scope": [
"python_pkg/steam_backlog_enforcer/library_hider.py",
"No behavioral change for valid game IDs; invalid IDs are silently skipped"
],
"changes": [
"Replace bare SetAppsAsHidden() call with safeHide() recursive binary-search fallback that skips IDs rejected by Steam's AddApps internals",
"Improve _cdp_result_value() to extract actual JS error from exceptionDetails (exception.description / text) instead of always reporting 'Unknown JS error'",
"Increase _CDP_TIMEOUT from 30s to 120s to accommodate extra fallback calls when problematic IDs trigger individual-retry path"
],
"verification": [
{
"command": "python -c \"from python_pkg.steam_backlog_enforcer.library_hider import _evaluate_js, _cdp_result_value; ...safeHide test...\"",
"result": "pass",
"evidence": "Result: {\"hidden\":3,\"total\":6} - safeHide correctly hid 3 real IDs and silently skipped 3 fake/invalid IDs without throwing"
},
{
"command": "python -m pytest python_pkg/steam_backlog_enforcer/tests/ -x -q --tb=short",
"result": "pass",
"evidence": "590 passed, 0 failures, 100% coverage on steam_backlog_enforcer modules"
},
{
"command": "pre-commit run --files python_pkg/steam_backlog_enforcer/library_hider.py",
"result": "pass",
"evidence": "ruff, mypy, pylint, bandit all passed; only contract artifact hooks pending"
}
],
"risks": [
"safeHide silently skips problematic IDs instead of surfacing them; in theory a valid game could slip through if AddApps has a transient error — second pass via visibleApps would catch it",
"120s CDP timeout may mask genuinely hung JS evaluations"
],
"rollback": [
"git revert the library_hider.py changes to restore bare SetAppsAsHidden() call and 30s timeout",
"Verify tests still pass after rollback"
]
}