Telegram OSINT early-signal feed via Railway relay#249
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 434ecf30ee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!msg || !msg.id || !msg.message) continue; | ||
| const item = normalizeTelegramMessage(msg, channel); | ||
| newItems.push(item); | ||
| if (!telegramState.cursorByHandle[handle] || msg.id > telegramState.cursorByHandle[handle]) { | ||
| telegramState.cursorByHandle[handle] = msg.id; |
There was a problem hiding this comment.
Advance Telegram cursor for skipped non-text messages
The poll loop only updates cursorByHandle after passing if (!msg || !msg.id || !msg.message) continue;, so media-only posts (or other messages without message text) never advance the cursor. On channels that emit many non-text posts, each interval re-reads the same IDs, increasing API load/rate-limit risk and potentially preventing progression to newer text posts when the fetch limit window is saturated.
Useful? React with 👍 / 👎.
| pollTelegramOnce().catch(() => {}); | ||
| setInterval(() => { | ||
| pollTelegramOnce().catch(() => {}); |
There was a problem hiding this comment.
Prevent overlapping Telegram poll executions
The interval starts a new pollTelegramOnce() on a fixed schedule without checking whether the previous poll is still running. Since each poll performs network calls per channel and an intentional per-channel delay, slower runs can overlap, causing concurrent reads/writes to shared cursor state and duplicate upstream requests that make Telegram throttling more likely.
Useful? React with 👍 / 👎.
Adds true Telegram channel ingestion (MTProto via GramJS) to the existing Railway relay service and exposes it to the web app.
What’s included
Config (Railway relay)
Config (Vercel)
Notes
Next steps (follow-up PR)