Is het mogelijk om de Leaderboard URL op de een of andere manier handmatig opnieuw in te stellen?
Bijvoorbeeld leaderboards/2 naar leaderboards/1.
Is het mogelijk om de Leaderboard URL op de een of andere manier handmatig opnieuw in te stellen?
Bijvoorbeeld leaderboards/2 naar leaderboards/1.
Is it possible to award points to a user as an extra reward? ![]()
You may want to see:
which has this curl request inside:
curl --location 'https://my.discourse.com/admin/plugins/gamification/score_events' \
--header 'Api-Key: <your key>' \
--header 'Api-Username: <your username>' \
--header 'Content-Type: application/json' \
--data '{
"user_id": "101",
"date": "2024-05-15",
"points": "-141",
"description": "Gamification point adjustment"
}'
Ik heb deze plugin in de admin geopend, maar de tab Leaderboard verscheen niet automatisch. Ik heb ook geen nieuwe leaderboards toegevoegd. Waarom niet? Waar kan ik deze leaderboards bekijken?
I think you have to add them to the sidebar yourself
. The leaderboards are at /leaderboard, /leaderboard/2, /leaderboard/3 etc.
Is het mogelijk om een leaderboard te maken voor een specifieke categorie of tag?
Leaderboards are tied to groups. But you can specify which categories affect all the leaderboards in the gamification settings. Seems like an interesting idea to move that to the leaderboard, to for example have a Support leaderboard here in this community.
2 posts were split to a new topic: Reducing points for flagged users
Is there a way for me to exclude myself from the rankings?
yes add yourself to a new group (call it âleaderboard-exclusionâ or something) and then exclude the group in the plugin settings.
edit: this will also easily allow you to exclude anyone else if you so wish at some point, by adding them to the same group. ![]()
Thank you so much. That makes sense.
After I upgraded to version 2026.1.0, I created a monthly leaderboard, and then accessing the following route caused an error:
http://localhost:4200/admin/plugins/discourse-gamification/leaderboards
The error is as follows:
assert.js:40
Uncaught (in promise) Error: Assertion Failed: You attempted to update `_value` on `TrackedStorageImpl`, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.
`_value` was first used:
- While rendering:
{{outlet}} for -top-level
-top-level
{{outlet}} for application
application
DiscourseRoot
{{outlet}} for admin
admin
{{outlet}} for adminPlugins
admin-plugins
{{outlet}} for adminPlugins.show
show
AdminPluginConfigPage
AdminPluginConfigArea
{{outlet}} for adminPlugins.show.discourse-gamification-leaderboards
adminPlugins.show.discourse-gamification-leaderboards
{{outlet}} for adminPlugins.show.discourse-gamification-leaderboards.index
discourse-gamification-leaderboards
DPageSubheader
(result of a `unknown` helper)
Stack trace for the update:
at TrackedArray._dirtyCollection2 (array.ts:163:13)
at Object.set (array.ts:126:15)
at Proxy.sort (<anonymous>)
at AdminPluginsShowDiscourseGamificationLeaderboardsIndexController.sortedLeaderboards (index.js:23:1)
at AdminPluginsShowDiscourseGamificationLeaderboardsIndexController.<anonymous> (handle-descriptor.js:67:17)
I located the problematic file as follows:
plugins/discourse-gamification/admin/assets/javascripts/discourse/controllers/admin-plugins/show/discourse-gamification-leaderboards/index.js
Specific code:
@discourseComputed("model.leaderboards.@each.updatedAt")
sortedLeaderboards(leaderboards) {
return (
leaderboards?.sort((a, b) => compare(b?.updatedAt, a?.updatedAt)) || [] // line 22
);
}
The reason for the error is:
Ember.js (or more accurately, the Glimmer tracking system) assertion error in reactive state management. The core reason is: within the same computation cycle, you first read a tracked (tracked state) value, and then attempt to modify that value. This âuse then updateâ operation can lead to logical confusion, infinite loops, or performance issues, so Ember directly prohibits this behavior.
Key issue:
Array.sort() modifies the original array in place, which updates the @tracked leaderboards state.
The responsibility of a computed property (sortedLeaderboards) is to derive a new value, not to modify the original state; it should itself be a âpure functionâ (no side effects, does not modify the input source).
Here is the fix:
@discourseComputed("model.leaderboards.@each.updatedAt")
sortedLeaderboards(leaderboards) {
return (
//leaderboards?.sort((a, b) => compare(b?.updatedAt, a?.updatedAt)) || []
leaderboards?.slice().sort((a, b) => compare(b?.updatedAt, a?.updatedAt)) || []
);
}
Screenshot after fixing:
And this kind of similar issue doesnât seem to be an isolated case. I suspect itâs an incompatibility issue caused by the emberjs upgrade. However, many places in plugins havenât been modified to keep up with the upgrade, as this work is not as simple as it sounds.
Hello everyone, regarding the points for this plugin, currently, there is only an increase function. If I have a need to decrease points, for example, initiating a vote requires deducting 10 points, or points can be exchanged for benefits (physical goods or virtual services, etc.), what should I do? Are there other plugins that support this?