3x-ui/internal/web/service/tgbot
BlindMaster24 2fcd28c1bc
refactor(tgbot): make the add-client expiry presets say what they do (#6503)
* refactor(tgbot): make the add-client expiry presets say what they do

The wizard's "Add N days" buttons were a copy of the renewal handler, whose
accumulate branch they cleared two lines later: the branch tested a value the
line above had just set to zero, so it was dead and only the "set N days from
first use" path was reachable. That reads as an accident, and the automated
review of #6499 flagged it twice.

The wizard keeps the term it sets, which is now the code: a create flow has no
expiry to add to, the custom keypad lands in this same case, and a corrected
number has to replace the one it follows. 0 stays the Unlimited button. The
renewal handler (reset_exp_c) genuinely adds to the client's remaining time and
is unchanged.

* refactor(tgbot): fold in the review of the expiry-preset change

The test now starts every row from a term a preset could have left, so each row
fails on its own under the accumulate semantics rather than depending on the row
before it, and it reuses the package's draft helpers instead of a second copy.
The wizard presets drop the "Add" verb they never honoured; the renewal
keyboard keeps it, where reset_exp_c really does add to the remaining time.
2026-09-13 19:57:46 +02:00
..
numeric_input.go refactor(tgbot): extract the shared numeric keypad builder 2026-09-10 21:07:57 +02:00
numeric_input_test.go test(tgbot): detect open-coded keypad transitions (#6214) 2026-08-15 15:27:02 +02:00
tgbot.go fix(tgbot): keep the add-client draft with the chat that owns it (#6499) 2026-09-13 19:48:54 +02:00
tgbot_add_client_expiry_test.go refactor(tgbot): make the add-client expiry presets say what they do (#6503) 2026-09-13 19:57:46 +02:00
tgbot_admin_list_race_test.go fix(tgbot): read the admin list and running flag under their mutex (#6491) 2026-09-13 11:46:36 +02:00
tgbot_callback_auth_test.go Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
tgbot_client.go fix(tgbot): keep the add-client draft with the chat that owns it (#6499) 2026-09-13 19:48:54 +02:00
tgbot_client_draft_per_chat_test.go fix(tgbot): keep the add-client draft with the chat that owns it (#6499) 2026-09-13 19:48:54 +02:00
tgbot_client_expiry_test.go fix(tgbot): render a disabled start-after-first-use client as days (#6500) 2026-09-13 19:48:14 +02:00
tgbot_client_links_authz_test.go fix(tgbot): require client ownership for non-admin link callbacks (#6489) 2026-09-13 11:46:14 +02:00
tgbot_declined_callback_test.go fix(tgbot): answer the callbacks the bot cannot route (#6493) 2026-09-13 11:47:22 +02:00
tgbot_delete_after_test.go Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
tgbot_draft_render_test.go refactor(tgbot): make the add-client expiry presets say what they do (#6503) 2026-09-13 19:57:46 +02:00
tgbot_event.go feat(memory): add memory threshold alerts (#5366) 2026-06-21 17:45:33 +02:00
tgbot_inbound.go fix(tgbot): keep the add-client draft with the chat that owns it (#6499) 2026-09-13 19:48:54 +02:00
tgbot_report.go fix(tgbot): read the admin list and running flag under their mutex (#6491) 2026-09-13 11:46:36 +02:00
tgbot_report_batching_test.go fix(tgbot): send the admin traffic reports as one message (#6490) 2026-09-13 12:52:55 +02:00
tgbot_router.go refactor(tgbot): make the add-client expiry presets say what they do (#6503) 2026-09-13 19:57:46 +02:00
tgbot_send.go fix(tgbot): read the admin list and running flag under their mutex (#6491) 2026-09-13 11:46:36 +02:00
tgbot_send_test.go fix(tgbot): use a token telego accepts in the edit-message tests 2026-09-06 17:32:01 +02:00
tgbot_stale_button_test.go fix(tgbot): guard the mock Telegram server's call counts 2026-09-13 12:01:56 +02:00
tgbot_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00