Skip to content

Add ConditionalMetadataUpdate option to challenge score submit#104

Merged
sesposito merged 1 commit into
mainfrom
spe/add-ch-metadata-conditional-update
Aug 8, 2025
Merged

Add ConditionalMetadataUpdate option to challenge score submit#104
sesposito merged 1 commit into
mainfrom
spe/add-ch-metadata-conditional-update

Conversation

@sesposito

Copy link
Copy Markdown
Member

No description provided.

@sesposito sesposito requested a review from novabyte August 6, 2025 18:09

@novabyte novabyte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sesposito Thanks 🙏 looks good, only one minor question 👍

Comment thread challenge.go

// 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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is the parameter named the same as the metadata related override we support with event leaderboard score submissions?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zyro what do you suggest?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update as part of this PR

@sesposito sesposito force-pushed the spe/add-ch-metadata-conditional-update branch from 418cae2 to d6abe76 Compare August 8, 2025 16:34
@sesposito sesposito merged commit 586a702 into main Aug 8, 2025
2 checks passed
@sesposito sesposito deleted the spe/add-ch-metadata-conditional-update branch August 8, 2025 16:54
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

Successfully merging this pull request may close these issues.

3 participants