fix: handle follower and shout notifications in notifications_seen_thread
All checks were successful
Deploy on push / deploy (push) Successful in 3m13s
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:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user