Skip to content

fix(channel): return success when bind code is re-checked by same identity#201

Merged
sheepbox8646 merged 2 commits intomemohai:mainfrom
0x24a:main
Mar 7, 2026
Merged

fix(channel): return success when bind code is re-checked by same identity#201
sheepbox8646 merged 2 commits intomemohai:mainfrom
0x24a:main

Conversation

@0x24a
Copy link
Contributor

@0x24a 0x24a commented Mar 7, 2026

Problem

When binding a user identity via Telegram, the bot returns "Bind code already used" even though the binding process has succeeded in the database.

Root Cause

IdentityResolver.Resolve() is being called twice for each inbound message: by the middleware layer and HandleInbound. The second response overwrites the first, so the user only sees the error.

Fix

Add a check in tryHandleBindCode, When a bind code has already been used, check if it was used by the same channel identity. If yes, then return the success reply instead of an error.

@sheepbox8646 sheepbox8646 merged commit ac405c4 into memohai:main Mar 7, 2026
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.

2 participants