mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5816] [CLOSED] fix(tgbot): resolve Telegram usage lookup by clients.tg_id #5996
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5996
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5816
Author: @rqzbeh
Created: 7/5/2026
Status: ❌ Closed
Base:
main← Head:fix/tgbot-compact-tgid📝 Commits (2)
be222fbfix(tgbot): resolve Telegram usage lookup by clients.tg_id53cc3ecfix(tgbot): merge tg_id and settings email sources📊 Changes
2 files changed (+184 additions, -18 deletions)
View changed files
📝
internal/web/service/inbound_client_traffic_test.go(+148 -0)📝
internal/web/service/inbound_traffic.go(+36 -18)📄 Description
Summary
Fix Telegram bot usage lookup when inbound
settingsJSON storestgIdwithout a space after the colon (common after node sync/import).Why
Closes #5805. The bot used
settings LIKE '%"tgId": 123%', which misses compact"tgId":123and returned no client traffic.Type of change
Areas affected
clients.tg_id)How was this tested?
go test -shuffle=on -count=1 ./internal/web/service -run GetClientTrafficTgBotTestGetClientTrafficTgBotFallsBackToInboundSettings(legacy settings-only rows)TestGetClientTrafficTgBotLegacyCompactJSON(compact JSON, noclientsrow)Screenshots / recordings
N/A
Breaking changes
None
Checklist
go build ./...and the test suite pass locally.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.