While writing a JS Lambda Function whose purpose is to search through Game Sessions accepting players on a single fleet, create a player session in one of the game sessions and return that player session to the application client, I have encountered a problem dealing with the return value of gamelift.searchGameSessions
I was able to diagnose the problem stemming from my handling of a returned gameSessions object. According to Amazon documentation [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/gamelift/search-game-sessions.html], gameSessions should return a list with each index being an active game session on the fleet that matches the filter expression (in my case, hasAvailablePlayerSessions=true).
The error log shows I am capturing the one created gameSesssion that matches the filter expression, but after assigning the returned value from the searchGameSessions function to a variable called gameSessions, I assigned selectedGameSession = gameSessions which should return the gameSession object held in the 0th index of gameSessions. However, this assigment results in selectedGameSession.GameSessionId = undefined, which prevents me from creating a player session in the game session. Not sure how else to approach this particualr problem