3x-ui/internal/web
BlindMaster24 1691c9ca2a
fix(tgbot): keep the add-client draft with the chat that owns it (#6499)
* fix(tgbot): keep the add-client draft with the chat that owns it

The wizard held one package-level draft for the whole bot. Its steps run on
the ten-goroutine worker pool, so two admins adding a client at the same time
wrote into the same form: whichever step ran last decided the email, the
limits and the attached inbounds of a client the other chat went on to
create, and the attach picker mutated one shared slice from several
goroutines at once as well.

Each chat now gets its own draft, reached only through the chat that owns it
and held for the duration of a step, so a client is created from the values
its own chat collected.

* fix(tgbot): take the wizard's draft lock only for the wizard

A queued report tap held one of the ten worker slots while it waited on the
chat's draft, and every chat that reached answerCallback grew the draft map
even when the admin gate rejected it. Both follow from acquiring the draft
before the gate; the wizard's own steps are the only callers that read it.

The draft is now looked up under the same admin-and-wizard check, addClient
takes the draft its caller locked instead of looking it up again, a submit
drops the entry, and StopBot clears the map with the conversation states.
2026-09-13 19:48:54 +02:00
..
controller feat(settings): add setting for Reality scan candidates (#6471) 2026-09-13 14:48:28 +02:00
entity feat(settings): add setting for Reality scan candidates (#6471) 2026-09-13 14:48:28 +02:00
global refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
job feat(discord): add Discord notification bot service (#6486) 2026-09-13 14:04:53 +02:00
locale feat(discord): add Discord notification bot service (#6486) 2026-09-13 14:04:53 +02:00
middleware fix(web): tighten database restore body-cap exemption (#5609) 2026-06-28 15:00:55 +02:00
network style: format struct literals and whitespace 2026-08-24 00:06:01 +02:00
runtime Feature/tuic v5 (#6337) 2026-09-12 10:15:48 +02:00
service fix(tgbot): keep the add-client draft with the chat that owns it (#6499) 2026-09-13 19:48:54 +02:00
session refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
translation feat(settings): add setting for Reality scan candidates (#6471) 2026-09-13 14:48:28 +02:00
websocket fix(nodes): keep the credential-presence flag on the node heartbeat push 2026-07-28 17:38:46 +02:00
cadence_test.go Add remote routing URL support (#6168) 2026-08-18 16:02:11 +02:00
routes_contract_test.go docs(api): align OpenAPI with runtime contracts (#6409) 2026-09-04 15:23:41 +02:00
web.go feat(discord): add Discord notification bot service (#6486) 2026-09-13 14:04:53 +02:00
web_mtls.go feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00
web_mtls_test.go feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00