[Sources] Message links like https://t.me/channel/451 are accepted but fail to index #10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current behaviour
The "Telegram chat" field in the Sources form (add-source dialog) accepts message links such as
https://t.me/telegram/451orhttps://t.me/somechannel/12345. These pass through_normalize_telegram_chat_identifier()unchanged becausetelethon.utils.parse_usernamedoes not recognise thet.me/<channel>/<message_id>shape (it returns(None, False)), so the value is stored verbatim as theSource.telegram_chat.At indexing time,
_resolve_chat()(app/telegram/indexer.py) callsclient.get_entity("https://t.me/telegram/451"), which raises ValueError and the source never indexes.Verified on current code:
So the message-link shape is neither normalised to a channel nor rejected - it silently becomes a source that can never be indexed.
Desired behaviour
Either:
https://t.me/telegram/451is stored as@telegramand indexes normally.Option 2 is the more forgiving UX and reuses the existing normaliser, but it should be a deliberate choice. Either way, the stored value must always be a shape
_resolve_chatunderstands (@username, numeric id, or t.me/+invite).Related
Introduced alongside the t.me link support in PR #9 / issue #4 - that only handled
t.me/<username>channel links andt.me/+inviteinvite links, nott.me/<username>/<message_id>message links.Branch preview deployed by CI.
fix/message-link-normalisedf887fbee0121bcd0d820cd34870d90b352a983dAuto-generated by
.forgejo/workflows/dev-deploy.yml.