chore: expand curated Telegram channels list (global/ME/Iran/cyber)#249
chore: expand curated Telegram channels list (global/ME/Iran/cyber)#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 👍 / 👎.
scripts/ais-relay.cjs
Outdated
| 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 👍 / 👎.
0294b32 to
3b6a036
Compare
3b6a036 to
08d2e87
Compare
This PR is now a data-only update after rebase.
What changed
data/telegram-channels.json(curated product-managed list).channels.fullfrom 15 to 27 channels (+12, none removed).updatedAtmetadata.Added handles
abualiexpress,DefenderDome,englishabuali,IranIntl,OsintUpdates,CyberDetective,Middle_East_Spectator,MiddleEastNow_Breaking,OSINTIndustries,osintlive,OsintTv,spectatorindexWhat did not change
Telegram runtime support was already merged into
mainearlier.This PR does not change Telegram ingestion code paths (
api/telegram-feed.js,scripts/ais-relay.cjs,scripts/telegram/session-auth.mjs).