Skip to content

Longer last attempt for Steamworks, return better error code#870

Merged
tudddorrr merged 1 commit intodevelopfrom
improve-steam-client
Feb 28, 2026
Merged

Longer last attempt for Steamworks, return better error code#870
tudddorrr merged 1 commit intodevelopfrom
improve-steam-client

Conversation

@tudddorrr
Copy link
Collaborator

No description provided.

@claude
Copy link

claude bot commented Feb 28, 2026

This PR is clean overall — the 503 fix and longer final-attempt timeout are both sensible improvements. One minor issue and one note below.


🔵 Minor

typeof err.cause === 'number' is overly broad

identify.ts:96 — the check accepts any numeric cause, which means any future Error thrown anywhere in the try block that incidentally carries a numeric cause (from a library, ORM, etc.) would silently become an HTTP response instead of being re-thrown as a 500.

The steamworks errors only ever set cause to 400 or 503. Being explicit about the expected set is more defensive:

// Before (this PR)
if (err instanceof Error && typeof err.cause === 'number') {
  return ctx.throw(err.cause, err.message)
}

// Safer alternative
if (err instanceof Error && (err.cause === 400 || err.cause === 503)) {
  return ctx.throw(err.cause as number, err.message)
}

Note

steamworks-players.ts:32 — the comment // set the cause to 400 so the api doesn't return a 500 is now slightly misleading since 503 is also used in this function. Worth a small wording update if the above change is made.

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.00%. Comparing base (7b89393) to head (f9751b5).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #870   +/-   ##
========================================
  Coverage    96.99%   97.00%           
========================================
  Files          388      388           
  Lines         6132     6137    +5     
  Branches       784      785    +1     
========================================
+ Hits          5948     5953    +5     
  Misses          95       95           
  Partials        89       89           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tudddorrr tudddorrr force-pushed the improve-steam-client branch from a222907 to f9751b5 Compare February 28, 2026 13:06
@tudddorrr tudddorrr merged commit a26dc43 into develop Feb 28, 2026
10 checks passed
@tudddorrr tudddorrr deleted the improve-steam-client branch February 28, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant