fix(assistant): single use under racing requests, a cap on registering, Caddy reloaded

A connect code, an authorization code and a refresh token are each
consumed by deleting their row and going on only if that deleted it, so
of two requests racing with the same one only one succeeds (as OAuth
requires); tests race them. Registration, open to anyone, takes at most
200 clients an hour (429 after), so a flood can't fill the table before
pruning. The deploy reloads Caddy in place when deploy/Caddyfile changed,
as `docker compose up` doesn't restart it for a file it mounts: without
it the connector's paths wouldn't reach the web server.

Also formats the app's fake assistant gateway, new and so unchecked by
the last commit's check (tool/check.sh formats tracked files only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-10 12:20:47 +02:00
commit 9f1716f16d
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -6,6 +6,7 @@ import 'package:halkyon_learn_flutter/src/feature/assistant/model/connected_assi
class FakeAssistantGateway({
/// Where the connector is; none when null.
final String? url = 'https://learn.example.org/mcp',
/// The assistants connected at first.
final List<ConnectedAssistant> initially = const [],
}) implements AssistantGateway {