mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
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#6622
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/7051
Author: @DoctorGuidance
Created: 11/2/2026
Status: ❌ Closed
Base:
main← Head:fix/tgbot-client-pagination📝 Commits (1)
9a3b771fix(tgbot): allow pagination callbacks for non-admin clients (#7032)📊 Changes
4 files changed (+23 additions, -8 deletions)
View changed files
📝
internal/web/service/tgbot/screen_client_views.go(+2 -6)📝
internal/web/service/tgbot/screens_test.go(+11 -0)📝
internal/web/service/tgbot/tgbot_callback_auth_test.go(+6 -1)📝
internal/web/service/tgbot/tgbot_router.go(+4 -1)📄 Description
Summary of Changes
Fixes #7032
Root Cause
In
internal/web/service/tgbot/tgbot_router.go, when an incoming callback query is processed from a non-admin client (!isAdmin),isClientSelfCallback(callbackQuery.Data)is evaluated to filter allowed per-user callbacks:However, the pager callback identifiers (
cbPageNext = "pg:next",cbPagePrev = "pg:prev", andcbPageNone = "pg:none") were missing fromisClientSelfCallback. Consequently, when any client user with multiple accounts or links (which span multiple pages due to Telegram's 1024-character caption limit) tapped next/prev page buttons,isClientSelfCallbackreturnedfalse, and the router returned immediately without answering the query. This resulted in an endless loading spinner on the button and trapped client users on the first page.Additionally, in
internal/web/service/tgbot/screen_client_views.go,ownSubscriptionOnlyreturnedfalsefor multi-subscription clients due to a strictlen(traffics) == 1check, causing an admin-only "Client card" button (client_get_usage <email>) to be mistakenly offered to non-admin users.Solution
cbPageNext,cbPagePrev, andcbPageNonetoisClientSelfCallback:Pager navigation callbacks now pass the callback gate safely and trigger
t.turnPage(). Pager state is strictly per-chat (t.screens().get(chatID)), maintaining complete chat isolation.ownSubscriptionOnly:Updated the check to verify
t.clientOwnedByTgUser(chatID, email)instead of single-item length, ensuring multi-account client users are recognized as owners and never offered admin-only client management cards.TestIsClientSelfCallbackto assertpg:next,pg:prev, andpg:noneare permitted per-user callbacks.TestClientCanReachPaginationCallbacksto prevent regressions.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.