Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colons in Nakama Leaderboard ID #306

Closed
1 task done
amerryma opened this issue Mar 4, 2019 · 3 comments
Closed
1 task done

Colons in Nakama Leaderboard ID #306

amerryma opened this issue Mar 4, 2019 · 3 comments

Comments

@amerryma
Copy link

amerryma commented Mar 4, 2019

Description

Using the leaderboard feature for Nakama (2.4), I'm having an issue using a colon : in a leaderboard_id. Right now I'm getting a 500 error using the rest api to fetch the data. Example: GET /v2/leaderboard/some:leaderboard. I am able to create the leaderboard and add leaderboard records, but not fetch anything.

Steps to Reproduce

  1. Create a leaderboard with Lua pcall(nk.leaderboard_create, "test:leaderboard", false, "desc", "incr", cron, metadata)
  2. Create a leaderboard record with Lua: pcall(nk.leaderboard_record_write, "test:leaderboard", ownerId, userId, pointValue)
  3. Use Rest API to Fetch Data:
    curl -H "Authorization: Bearer <bearer>" "localhost/v2/leaderboard/test%3Aleaderboard?limit=10"
    
    or
    curl -H "Authorization: Bearer <bearer>" "localhost/v2/leaderboard/test:leaderboard?limit=10"
    

Expected Result

Returns the leaderboard records.

Actual Result

Returns a 404 Not Found (no logs).

Context

  • Rest API & Lua RPC

Your Environment

@amerryma
Copy link
Author

amerryma commented Mar 5, 2019

Just a follow up. This may be related to this: grpc-ecosystem/grpc-gateway#224

After some testing, I'm able to use GET localhost/v2/leaderboard/test:leaderboard:?limit=10 as a workaround. Note the second colon.

@zyro
Copy link
Member

zyro commented Mar 5, 2019

@amerryma I can reproduce it too. It looks like it's definitely related to grpc-ecosystem/grpc-gateway#224 as you say.

I'll look into workarounds but your best bet for now is to avoid : characters in the leaderboard ID.

@zyro
Copy link
Member

zyro commented Jun 19, 2019

grpc-ecosystem/grpc-gateway#224 appears to be resolved. This issue should be fixed through the dependency update in c97ad15, and will be part of the next release.

@zyro zyro closed this as completed Jun 19, 2019
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

No branches or pull requests

2 participants