tangled
alpha
login
or
join now
bunware.org
/
void
forked from
cameron.stream/void
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
Handle deleted posts gracefully in thread fetching
cameron.stream
9 months ago
c44f9463
17a39203
+16
-5
1 changed file
expand all
collapse all
unified
split
bsky.py
+16
-5
bsky.py
···
102
102
author_name = notification_data.author.display_name or author_handle
103
103
104
104
# Retrieve the entire thread associated with the mention
105
105
-
thread = atproto_client.app.bsky.feed.get_post_thread({
106
106
-
'uri': uri,
107
107
-
'parent_height': 80,
108
108
-
'depth': 10
109
109
-
})
105
105
+
try:
106
106
+
thread = atproto_client.app.bsky.feed.get_post_thread({
107
107
+
'uri': uri,
108
108
+
'parent_height': 80,
109
109
+
'depth': 10
110
110
+
})
111
111
+
except Exception as e:
112
112
+
error_str = str(e)
113
113
+
# Check if this is a NotFound error
114
114
+
if 'NotFound' in error_str or 'Post not found' in error_str:
115
115
+
logger.warning(f"Post not found for URI {uri}, removing from queue")
116
116
+
return True # Return True to remove from queue
117
117
+
else:
118
118
+
# Re-raise other errors
119
119
+
logger.error(f"Error fetching thread: {e}")
120
120
+
raise
110
121
111
122
# Get thread context as YAML string
112
123
thread_context = thread_to_yaml_string(thread)