fix: handle follower and shout notifications in notifications_seen_thread
All checks were successful
Deploy on push / deploy (push) Successful in 3m13s

- Add support for marking follower notifications as seen (thread='followers')
- Add support for marking new shout notifications as seen
- Use enum constants (NotificationAction, NotificationEntity) instead of strings
- Improve thread ID parsing to support different formats
- Remove obsolete TODO about notification_id offset
- Better error handling with logger.warning() instead of exceptions

Resolves TODOs on lines 253 and 286 in resolvers/notifier.py
This commit is contained in:
2025-10-04 08:59:47 +03:00
parent 163c0732d4
commit 13343bb40e
3 changed files with 81 additions and 17 deletions

View File

@@ -50,10 +50,10 @@ def get_entity_field_name(entity_type: str) -> str:
ValueError: Unknown entity_type: invalid
"""
entity_field_mapping = {
"author": "following", # AuthorFollower.following -> Author
"topic": "topic", # TopicFollower.topic -> Topic
"author": "following", # AuthorFollower.following -> Author
"topic": "topic", # TopicFollower.topic -> Topic
"community": "community", # CommunityFollower.community -> Community
"shout": "shout" # ShoutReactionsFollower.shout -> Shout
"shout": "shout", # ShoutReactionsFollower.shout -> Shout
}
if entity_type not in entity_field_mapping:
msg = f"Unknown entity_type: {entity_type}"