Skip to content

fix(config): support numeric telegram chat_id binding match - #34

Merged
jamiepine merged 1 commit into
spacedriveapp:mainfrom
cyllas:fix/telegram-chat-id-binding
Feb 18, 2026
Merged

fix(config): support numeric telegram chat_id binding match#34
jamiepine merged 1 commit into
spacedriveapp:mainfrom
cyllas:fix/telegram-chat-id-binding

Conversation

@cyllas

@cyllas cyllas commented Feb 18, 2026

Copy link
Copy Markdown

Summary

  • Fix Telegram binding resolution to accept numeric telegram_chat_id metadata in addition to string values.
  • Keep chat_id comparison stable by normalizing metadata to string before matching.
  • Restores reliable one-chat-per-agent routing for Telegram bindings.

Why

Telegram metadata writes telegram_chat_id as a JSON number, while binding config provides chat_id as a string. The previous matcher only read string metadata, so valid bindings could be skipped.

Validation

  • cargo test --lib (43 passed)

Fixes #33

@jamiepine
jamiepine merged commit 969a583 into spacedriveapp:main Feb 18, 2026
rktmeister pushed a commit to rktmeister/spacebot that referenced this pull request Mar 11, 2026
…binding

fix(config): support numeric telegram chat_id binding match
pasogott pushed a commit to pasogott/spacebot that referenced this pull request Aug 15, 2026
Task spacedriveapp#34. The API rejects every path except health with 401 when
api.auth_token is set (src/api/server.rs:399), and client.ts issued all
90 of its requests without the header, so configuring a token broke the
dashboard outright. client-typed.ts already built the header for the
openapi-fetch client; client.ts never used it.

apiFetch carries the header and every call site in client.ts goes
through it. getAuthHeaders moves to client.ts and client-typed.ts
imports it rather than keeping a second copy. The health check in
useServer.tsx stays a bare fetch, matching the middleware's exemption.

Not covered, and the reason api.auth_token still is not supported end to
end: EventSource and any URL handed to an img or a download cannot carry
a header, so the SSE stream, avatars, project logos and attachments stay
unauthenticated. Closing that needs a token-bearing scheme for
header-less requests, which is a separate decision.
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.

bug(messaging): Telegram chat_id binding mismatch due to metadata type conversion

3 participants