fix: classify SDG bingo missions correctly instead of daily_challenge (#221) - #233
Open
vedant7007 wants to merge 2 commits into
Open
fix: classify SDG bingo missions correctly instead of daily_challenge (#221)#233vedant7007 wants to merge 2 commits into
vedant7007 wants to merge 2 commits into
Conversation
…_challenge (arzoo0511#221) Bingo.tsx dispatched every mission tick as a bare `ADD_POINTS` with just a numeric payload. GameContext's dispatch reducer falls back to `'daily_challenge'` when no activityType is provided, so every one of the 51 SDG bingo tasks landed in xp_ledger with `activity_type = 'daily_challenge'`. That polluted the daily-challenge counter used for stats/streaks and could trip a per-day cap on daily_challenge, silently starving either bingo XP or real daily challenges. - add `bingo_mission` to the ActivityType union - Bingo.tsx now dispatches with `activityType: 'bingo_mission'` and metadata (goalIndex, taskIndex, sdgTitle) so the ledger row is queryable and consistent with the pattern used elsewhere Note: the backend `award_xp_secure` RPC needs a matching entry for `bingo_mission` in its activity table. Until then it will either fall back to a default XP calc or reject the activity; happy to iterate on that in a follow-up once the maintainer flags either behavior. Fixes arzoo0511#221
|
@vedant7007 is attempting to deploy a commit to the arzoorai0207-5745's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
hey! heads up — the failing this PR doesn't touch |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
`Bingo.tsx` dispatched every mission tick as a bare `ADD_POINTS` with only a numeric payload. GameContext's reducer at line 589-591 falls back to `'daily_challenge'` when no `activityType` is provided, so all 51 SDG bingo tasks landed in `xp_ledger` with `activity_type = 'daily_challenge'`.
That corrupts:
What changed
Follow-up needed on the backend
The `award_xp_secure` RPC has an activity table on its side. If `bingo_mission` isn't in it, the RPC will either fall back to a default XP calc or reject the activity. Happy to iterate on that in a follow-up once the maintainer flags which behavior applies — the frontend change here is the necessary first step regardless.
Test plan
Fixes #221