fix(config): support numeric telegram chat_id binding match - #34
Merged
jamiepine merged 1 commit intoFeb 18, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
telegram_chat_idmetadata in addition to string values.chat_idcomparison stable by normalizing metadata to string before matching.Why
Telegram metadata writes
telegram_chat_idas a JSON number, while binding config provideschat_idas a string. The previous matcher only read string metadata, so valid bindings could be skipped.Validation
cargo test --lib(43 passed)Fixes #33