From 93cca6b0d2d3d1423d8e649c4dcfab3c2d01e0d6 Mon Sep 17 00:00:00 2001 From: Cameron Pfiffer Date: Thu, 22 May 2025 12:31:17 -0700 Subject: [PATCH] refactor: Restore thread URI logic in process_event function - Reintroduced the logic to determine the thread URI based on the presence of a root post URI or fallback to the post URI. - Added debug logging to track which thread is being fetched, enhancing traceability in event processing. This change improves the clarity and functionality of the thread retrieval process in the jetstream consumer. --- src/jetstream_consumer.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/jetstream_consumer.py b/src/jetstream_consumer.py index 09492a9..782bc7f 100644 --- a/src/jetstream_consumer.py +++ b/src/jetstream_consumer.py @@ -292,10 +292,8 @@ async def process_event( # Get the thread containing the post. If a root post URI is provided, use that # to get the thread, otherwise use the post URI. - # thread_uri = root_post_uri if root_post_uri else post_uri - # logger.debug(f"Getting thread for {'root post' if root_post_uri else 'post'}", thread_uri) - - thread_uri = post_uri # note, removing this post for now in order to not seek the root post + thread_uri = root_post_uri if root_post_uri else post_uri + logger.debug(f"Getting thread for {'root post' if root_post_uri else 'post'}", thread_uri) # Use depth=0 to fetch the complete thread with all replies # This ensures we get all branches of the conversation -- 2.51.2