Skip to content

fix: restore global Telegram bot confirmation actions - #160

Merged
SamNet-dev merged 2 commits into
SamNet-dev:mainfrom
rmtshnik:codex/fix-bot-confirmations
Oct 28, 2026
Merged

SamNet-dev merged 2 commits into
SamNet-dev:mainfrom
rmtshnik:codex/fix-bot-confirmations

Conversation

@rmtshnik

@rmtshnik rmtshnik commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The bot shows "Restart the proxy?" but pressing Yes does not run the command. _cb_render_confirm clears the target before constructing the keyboard, producing c:restart:. The strict callback decoder rejects the empty field. Update and rotate-all have the same problem; Lockdown also loses its on/off argument. Cancel produces another invalid payload (u:s::0).

Change

Preserve the callback target separately from the display label. Keep _ for targetless global actions and retain on/off for Lockdown. Global Cancel returns to the Tools menu (g). The callback grammar and role checks remain unchanged.

Add regression coverage that opens each real confirmation screen, extracts the emitted Yes payload, and passes it back through the dispatcher. Verify that prompting/cancelling executes nothing, confirmation calls the expected CLI command exactly once, and a reseller cannot execute it.

Document why traffic totals can be identical for 24h/7d/30d: cumulative counters and dated history samples are separate. A recent history cannot reconstruct past daily usage, and the default 7-day retention cannot provide a complete 30-day window.

Validation

CI on the final commit: https://github.com/rmtshnik/MTProxyMax/actions/runs/40659198452

Bash parsing, unit suites on five distributions, and systemd/OpenRC integration are checked by this workflow. ShellCheck may still be running when this PR is opened.

Traffic history retention

For a complete 30-day traffic window, configure:

TELEGRAM_HISTORY_RETENTION_DAYS='30'

The default is 7 days. The 30-day selector alone does not increase retention. A full window also requires 30 days of collected samples: increasing retention does not restore already-pruned records or reconstruct dated usage from cumulative counters. This requirement is also documented in the README change included in this PR.

@SamNet-dev
SamNet-dev merged commit 49f7080 into SamNet-dev:main Oct 28, 2026
8 checks passed
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