Skip to content

0.8.0

Choose a tag to compare

@fkrzski fkrzski released this 07 Oct 05:20
· 83 commits to master since this release
Immutable release. Only release title and notes can be modified.
cb04d9f

Adds GetNewsForApp (ISteamNews) and request, response and failure hooks on the connector, and keeps the API key out of debug output and exceptions. Contains breaking changes.

Added

  • GetNewsForAppRequest (ISteamNews) with the AppNews and NewsItem DTOs, returning a page of a game's news with Steam's total for the filter, reached anonymously through the new NewsResource as $connector->news()->appNews(). Steam answers an app ID it does not know exactly like some apps that exist, so both raise the new AppNewsUnavailableException (#77).
  • SteamConnector::onRequest() and onResponse(), fired on every attempt including under sendAsync() and pool(), with the key-free RequestSending and ResponseReceived payloads: the Steam method, the query, the attempt number and, on the response, the status and the duration in seconds. A 429 reaches onResponse before it becomes SteamRateLimitException, and an exception thrown in a hook reaches the caller (#79).
  • SteamConnector::onFailure(), fired once per call under send(), sendAsync() and pool() with the exception the caller gets: after the retries, as the SDK exception, and also for a request refused locally for the quota or a missing key. An exception thrown in the hook is dropped, so the caller still gets the original (#80).
  • symfony/var-dumper in suggest, because the default dumpers behind debug() need it and Composer does not surface Saloon's own suggestion (#78).

Changed

  • BC break. getPrevious() is null on SteamConnectionException and on a SteamApiException raised from a 4xx or 5xx, where 0.7.0 chained Saloon's FatalRequestException or RequestException, so callers read the status from getCode() and the payload from response. Guzzle 7 quotes the request URI, API key included, in the exception beneath, and error trackers store every exception on the chain (#86).
  • BC break. ProfileNotPublicException::forSteamId(), ProfileNotPublicException::forPrivateOrMissing() and SteamUserNotFoundException::forVanity() require the Saloon Response, so callers building them by hand have to pass one. GetOwnedGamesRequest and ResolveVanityUrlRequest now do, which gives their failures a response, code 200 rather than 0 and the Steam method in the message (#90).
  • BC break. send(), sendAsync() and pool() raise the failure Steam reports in a 200 payload for GetOwnedGamesRequest, GetSteamLevelRequest, GetBadgesRequest, GetRecentlyPlayedGamesRequest, GetCommunityBadgeProgressRequest, ResolveVanityUrlRequest, UpToDateCheckRequest and GetServersAtAddressRequest, where they used to return the Response and leave the exception to dto(), so callers catch it around the call itself. The resource methods throw what they did before (#94).
  • Every exception built from a Steam response, and SteamConnectionException, opens its message with the Steam method called, as in GetFriendList: Steam API request failed with HTTP 500. Classes and codes are unchanged, so only code matching on the message text is affected (#81).

Fixed

  • SteamConnector::debugRequest(), and debug() through it, pass the callable a copy of the PSR request with the API key masked as key=***, while the request sent to Steam keeps it (#78).
  • SteamConnectionException masks the API key as key=*** in the Guzzle message it quotes (#86).
  • SteamConfig marks apiKey as #[\SensitiveParameter], so an invalid timeout or retry setting no longer puts the key among the stack-trace arguments when zend.exception_ignore_args is off (#86).
  • sendAsync() and pool() count a 4xx or 5xx against the daily budget and turn a 429 into SteamRateLimitException, refusing the requests after it locally, where they used to count only a 2xx and raise SteamApiException with code 429 (#85).
  • sendAsync() and pool() return the promise their response pipeline settles, so a middleware throwing on a 2xx rejects the call and a Response a middleware swaps in reaches the caller (#79).

Details

  • GetNewsForApp (ISteamNews) by @fkrzski in #83
  • debug() masks the API key by @fkrzski in #87
  • Failure exceptions no longer carry the API key by @fkrzski in #88
  • Meter failed responses in sendAsync() and pool() by @fkrzski in #89
  • Steam method in exception messages by @fkrzski in #91
  • Response missing on GetOwnedGames and ResolveVanityURL failures by @fkrzski in #92
  • Request and response hooks by @fkrzski in #93
  • Failure hook by @fkrzski in #95
  • Raise 200 failures in the response pipeline by @fkrzski in #96
  • Docs pass and release prep for 0.8.0 by @fkrzski in #97