Repository navigation
fix(identity): tie channel link codes to their app and claim them atomically (foreman-igvm) - #55
Merged
Merged
Conversation
…mically (foreman-igvm)
redeemChannelLinkCode never checked the code's channel, so a code made for
Telegram also linked a Discord account. The used check and the update were
two steps, so two redeems of one code could both link. Now a code for another
app is refused ("wrong_channel"), the claim is a conditional update on
used_at IS NULL, and a successful redeem returns the web user it linked to.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3R2sPwBzA2bpj3HT2BDv2
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hamchowderr
force-pushed
the
claude/channels-link-codes
branch
from
October 20, 2026 14:07
e0b0537 to
0cc521e
Compare
hamchowderr
marked this pull request as ready for review
October 22, 2026 17:36
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Requested by Chowderr · project thread
This is part 1 of 3 of the channels split, which replaces #54. Merge in order: this PR, then #57 (channels on the controller), then #58 (removing the old bots).
Before: a
/linkcode made for Telegram also linked a Discord account, because redemption never checked which app the code was for. Checking that a code was unused and marking it used were two separate steps, so two redeems of the same code could both succeed.After: a code made for a different app is refused with
wrong_channel. The code is claimed with a conditional update (used_at IS NULL), so only one redeem wins. A successful redeem also returns the web user it linked to, which #57 uses to move old channel threads over.How: the change is in
redeemChannelLinkCode(lib/identity.ts), andRedeemResultbecomes a discriminated union. The existing bots already reply "Code not found" for any other error, so they need no change here. Three unit tests are added.Beads: foreman-igvm
🤖 Generated with Claude Code
https://claude.ai/code/session_01T3R2sPwBzA2bpj3HT2BDv2