Skip to content

the feed_deactivated_warn is not sent to the ERROR_LOGGING_CHAT #550

@hellodword

Description

@hellodword

It looks like the feed_deactivated_warn message is always being sent to the user who subscribed to the feed, but if I set the ERROR_LOGGING_CHAT, I would expect that chat to receive all error messages.

lang_msg_body_map: dict[str, str] = {
lang: '\n'.join((
i18n[lang]['feed_deactivated_warn'],
(
(
reason.i18n_message(lang)
if isinstance(reason, web.WebError)
else reason
)
if reason
else ''
)
))
for lang in user_id_lang_map.values()
}
sub_count = len(subs)
feed_description = f'{feed.id}: {feed.link}'
del reason
_do_send: BatchTimeout[[db.Sub, str], None]
async with BatchTimeout[[db.Sub, str], None](
func=self._do_send,
timeout=TIMEOUT,
loop=env.loop,
on_success=self._on_subtask_deactivated,
on_canceled=self._on_subtask_canceled,
on_error=self._on_subtask_unknown_error,
on_timeout=self._on_subtask_timeout,
on_timeout_error=self._on_subtask_timeout_unknown_error,
) as _do_send:
for sub in subs:
_do_send(
sub=sub,
post=(
f'<a href="{feed.link}">{escape_html(sub.title or feed.title)}</a>\n' +
lang_msg_body_map[user_id_lang_map[sub.user_id]]
)
)
del sub, subs, feed, user_id_lang_map, lang_msg_body_map
logger.debug(f'Deactivated {sub_count} subs: {feed_description}')
async def _do_send(self, sub: db.Sub, post: Union[str, Post]) -> None:
self._stat.start()
try:
await self._send(sub, post)
finally:
self._stat.finish()
async def _send(self, sub: db.Sub, post: Union[str, Post]) -> None:
user_id = sub.user_id

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions