mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #7092] fix(tgbot): keep backup files in the chat and the menu below them #6645
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#6645
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/7092
Author: @Plus98ir
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:fix/tgbot-keep-backups📝 Commits (2)
18d2c6ffix(tgbot): keep backup files in the chat and the menu below them0fe3a42style(tgbot): keep newScreenTgbot's comment on newScreenTgbot📊 Changes
8 files changed (+168 additions, -15 deletions)
View changed files
➕
internal/web/service/tgbot/backup_delivery_test.go(+135 -0)📝
internal/web/service/tgbot/notices.go(+6 -7)📝
internal/web/service/tgbot/notices_test.go(+1 -1)📝
internal/web/service/tgbot/screen_view.go(+2 -2)📝
internal/web/service/tgbot/screen_views.go(+2 -2)📝
internal/web/service/tgbot/screens_test.go(+18 -1)📝
internal/web/service/tgbot/tgbot_report.go(+2 -2)📝
internal/web/service/tgbot/tgbot_router.go(+2 -0)📄 Description
Summary
Telegram backups no longer carry a Hide button, and the backup button now brings the menu back below the files it sends.
Why
Every bot notice has a Hide button, which deletes the message it sits on. That is fine for a report, but on a backup it deletes the file itself: one tap, with no confirmation, can remove the admin's only copy of the database. Both the
.dbfile andconfig.jsonhad the button, on the backup button path and on the scheduled path.The backup button also left the menu above the files, so an admin at the bottom of the chat had no menu in view.
Type of change
Areas affected
What changes for the admin
How was this tested?
New tests in
internal/web/service/tgbot/backup_delivery_test.go, which run the real backup code against a recording Telegram server and a real SQLite database:TestBackupFilesCarryNoHideButtoncovers the button and scheduled paths. It failed before the fix with the hide keyboard on both files.TestBackupButtonMovesTheMenuBelowTheFileschecks the call order: two documents, then the new menu, then deleting the old one. It failed before the fix with no menu sent.TestScheduledBackupLeavesTheMenuInPlacepasses with or without the fix, as it guards the behaviour above. I confirmed it fails when the menu move is added to the scheduled path.recordingServernow records multipart form fields, so tests can see an upload'sreply_markupand file name.Local results on Windows, on top of current
main:go build ./...,golangci-lint run(0 issues),go test -shuffle=on ./...,go test -racefor the tgbot package,npm run gen(no changes), and the frontend lint, tests and builds.make verifyas a single command could not run its Go steps here because Git BashmakedropsGOCACHE/GOPATH, so those steps were run directly.Not tested against the live Telegram API.
Breaking changes
None
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass. (no frontend changes)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.