Skip comment fetches for status-filtered posts; drop HelpScout inter-page sleep - #26
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dkships
marked this pull request as ready for review
July 10, 2026 00:56
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two speedups for the slow fetch paths.
ProductLift: filter by status before fetching comments.
get_feature_requestsfetched comments for every post (250ms sleep + one API call each), then applied the status filter afterwards. The filter now runs insidefetchFeatureRequestsbefore the comment loop, so filtered-out posts cost nothing. Same match semantics as before: status name compared case-insensitively, posts with no status excluded. On a portal with 200 posts and 20 matching, that's 180 fewer API calls and ~45s less sleeping per call.HelpScout: remove the inter-page sleep in
fetchConversations. The 250ms sleep was the effective pacer (~90-130 req/min with network time). Removing it lets pages run at network speed; the existing 170/min sliding-window cap and 429 retry/backoff keep us under HelpScout's documented 200/min limit.fetchMailboxeskeeps its sleep (PAGE_DELAY_MSis still used there).Behavior note:
pii_categories_redactedmay shrink when a status filter is set. It now reflects only PII found in the posts/comments actually returned, not in posts the filter would have discarded anyway. The returned data is scrubbed exactly as before.Tests: two new vitest cases mock
fetchand assert no/commentsrequest fires for posts that fail the filter, and that unfiltered calls still fetch comments for every post. 66/66 passing.🤖 Generated with Claude Code