Add ConditionalMetadataUpdate option to challenge score submit#104
Conversation
novabyte
left a comment
There was a problem hiding this comment.
@sesposito Thanks 🙏 looks good, only one minor question 👍
|
|
||
| // SubmitScore submits a new score to the challenge. | ||
| SubmitScore(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userId, challengeId string, score, subscore int64, metadata map[string]any) (challenge *Challenge, err error) | ||
| SubmitScore(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userId, challengeId string, score, subscore int64, metadata map[string]any, conditionalMetadataUpdate bool) (challenge *Challenge, err error) |
There was a problem hiding this comment.
nit: is the parameter named the same as the metadata related override we support with event leaderboard score submissions?
There was a problem hiding this comment.
It's the same we declared in the interface: https://github.com/heroiclabs/hiro/blob/main/event_leaderboards.go#L79
However I see that there's a discrepancy here: https://github.com/heroiclabs/hiro-gdk/blob/main/server/event_leaderboards.go#L115
There was a problem hiding this comment.
conditionalMetadataUpdate is the correct name, I think this is just a place where we failed to update it https://github.com/heroiclabs/hiro-gdk/blob/main/server/event_leaderboards.go#L115 and we should definitely do so.
There was a problem hiding this comment.
I'll update as part of this PR
418cae2 to
d6abe76
Compare
No description provided.