leaderboardRecordsList woes

Two issues.

  1. Calling let list = this.nk.leaderboardRecordsList( this.leaderboardId ); results in the following error:
    rpc error: code = Internal desc = TypeError: expects an array of owner ids or null at github.com/heroiclabs/nakama/v3/server.(*runtimeJavascriptNakamaModule).leaderboardRecordsList.func1 (native)

    • The documentation indicates that the owner ids list is optional.
    • We can’t pass null (it is not accepted, only an array or undefined )
  2. Calling let list = this.nk.leaderboardRecordsList( this.leaderboardId, ["00000000-0000-0000-0000-000000000000"] ); returns zero records in either list.records or list.ownerRecords. Below is a screenshot of the leaderboard record I’m trying to access.

Halp? :slight_smile:

  1. Versions: Nakama {3.5}, Mac Docker},
  2. Server Framework Runtime language (If relevant): Typescript

Hi @adbourdages,

With regards to your first issue, I can see that the documentation says it is an optional parameter but that the implementation suggests otherwise. We will double check the documentation and implementation for this to ensure they are correct going forward.

To your second issue, can you please explain why you would like to store a leaderboard record against the system user? Regardless, that function should ideally return the result, so if you wouldn’t mind raising an issue on the GitHub repository that would be very much appreciated and we can look into that.

Thanks for taking a look at it.

Concerning your question about why use the system user, I was testing with the API explorer in the console and ended up using that userId. I’ve since tested with a non-system user and the same problem exists.

So the leaderboardRecordsList doesn’t appear to work at all? I’m guessing something is wrong with my setup!?

The server version reported by the Nakama console is 3.2.1+6790d453. The nakama-runtime used in the project is 1.21.0 (from the changelog). The whole thing runs inside Docker Desktop on a mac.

Thanks for the update. Can you try updating to the latest version of Nakama (3.10.0 as of writing this) and see if you experience the same issue?

Of course! Being new to docker, I cut and pasted the docker-compose.yml file from a sample or documentation page.

Obviously it works now. Thanks!

1 Like