Repository navigation
Validate unique referrals and make Player colours immediate and exclusive - #62
Merged
Merged
Conversation
Replace share credits with signup attribution captured by Supabase Auth. Count each unique confirmed email once, relock unearned Gold, and serialize exclusive Player colours within a paired Duel. Add PostgreSQL regression checks and migration instructions for issue #58.
Apply colour metadata optimistically, confirm it from the RPC response, and restore it on rejection. Derive Player themes directly from Duel metadata so profile changes do not reload habit history. Show the opponent initial on their reserved colour and carry recommendation codes into new-account signup for issue #58.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 11, 2026
Keep incremental Duel synchronization, cached history and membership signup redirects from main alongside optimistic colours and signup referral attribution. Retain both PostgreSQL check suites and the current dependency versions.
A confirmation concurrent with creating or joining a Duel can miss its uncommitted membership and leave cached counters behind. Authorize Gold and return Player metadata from confirmed receipts instead, without introducing conflicting locks. Verify stale-counter entitlement and return values in PostgreSQL.
Maseeek
marked this pull request as ready for review
October 14, 2026 22:09
This branch was successfully deployed
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
Sharing a recommendation previously granted Gold immediately. A reward now requires a unique new account created through a Player-specific link and confirmed by email. Sharing, copying, self-referrals, existing accounts and repeated confirmation grant no credit.
The palette reserves the opponent’s colour and shows their themed initial. Supabase locks the Duel row and enforces distinct colours. Player metadata derives independently of incremental history synchronization. Displayed referral counts and Gold authorization use the confirmed ledger even if a confirmation races first pairing.
Merged current main into this branch, preserving incremental sync, cached history, membership signup redirects and both database check suites.
Closes #58.
Evidence
1 !== 0.npm run checkpasses 196 tests plus both PostgreSQL suites;npm run buildpasses. CI and Vercel preview build passed on70e12c4.20261014220745applied through Supabase MCP. Live rolled-back fixtures passed confirmation, self/existing/repeat rejection, immutable attribution, stable links, canonical rewards, Gold eligibility and colour exclusivity. No fixture records remain; existing Duel data stayed intact except the intended sharing-credit reset.Merge Danger
Door: Code is reversible. The migration replaces old sharing counts with confirmed referral counts and relocks unearned Gold; this reset has been applied.
Blast Radius: Player profiles and signup referrals.
Both SQL files have been applied in order to production. Supabase public REST still returns HTTP 402
exceed_egress_quota, so user-facing live API verification is blocked by the existing service restriction. No billing settings were changed.