Potential issues with the describePlayerSessions method in the GameLift class of the AWS SDK for Javascript

So recently I was playing around with the describePlayerSessions method and found a couple of issues. However, I’m not sure if all these “issues” are actually intended behavior.

  1. When passing in a valid PlayerSessionStatusFilter in combination with a valid PlayerSessionId, the filter is not applied. For example, if a player session is in the COMPLETED state, but you set the filter to ACTIVE, then you still get the player session associated with the id back. Also, if you pass in an invalid value for the filter with a valid value for the player session id, then no error is returned for the validation of the filter, so it seems that the filter is ignored completely when passing in a PlayerSessionId.
  2. When passing in a invalid value for the PlayerSessionStatusFilter, the error message returned does not indicate that. Since the filter doesn’t get applied when passing in a PlayerSessionId, this only occurs when passing in a valid PlayerId or a valid GameSessionId. Rather, the message describes an unrelated error:

Request must contain one and only one of PlayerSessionId, PlayerId, & GameSessionId.

I’m not sure if this only occurs with the Javascript version of the AWS SDK, but it may be worth checking in other programming language versions of the SDK.

Thanks in advance!

  1. I would assume that if you are asking for a given player session id the filter makes little sense (the most common use case is to get the info for the player session and then take action on its state etc). Although the documentation does not make clear about ignoring the parameter: https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribePlayerSessions.html

  2. I see this behaviour too in the aws cli

aws gamelift describe-player-sessions --game-session-id arn:aws:gamelift:us-west-2::gamesession/fleet-2cedd5e4-2a27-4ff2-8dcf-67d048e765ee/A1A330018BD6421D9B4E54C23581A7BD --player-session-status-filter INVALID_VALUE

An error occurred (InvalidRequestException) when calling the DescribePlayerSessions operation: Request must contain one and only one of PlayerSessionId, PlayerId, & GameSessionId.

I am guessing internally theres not a specific error message for this. Have reported this to the GameLift team.