Repository navigation
fix(hacker-news-app): drop deleted comments before applying comment_limit (#14421) - #14422
Merged
kodjima33 merged 2 commits intoSep 18, 2026
Merged
Conversation
Member
|
Thanks @boai-maker — verified end to end. This is a clean fix for a real bug. plugins/omi-hacker-news-app/main.py — get_discussion
plugins/omi-hacker-news-app/test_main.py
No dependency, workflow, or API-surface changes. Ready for a maintainer merge decision — leaving a positive signal here rather than a formal review, since this still needs a maintainer's sign-off. — automated maintainer review on behalf of the Omi maintainers by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
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.
Closes #14421
Problem
plugins/omi-hacker-news-app/main.py:252sliced children before filtering them:Algolia returns deleted and dead comments as ordinary children with a
nullor blanktext. The render loop skipped those, butlen(comments)andenumerateboth ran over the unfiltered slice, so:Top 3 comments:followed by one comment);2.when the first child was deleted;Top N comments:followed by nothing, because the list was still truthy and never reached the existingNo top-level comments returned.branch;comment_limitunder-delivered while printable comments sat just past the slice.Separately
childrenarrives as an explicitnullfor items with no replies.None[:limit]raisedTypeError, caught by the handler'sexcept (ValueError, TypeError)and surfaced asitem_id must be an integer— misleading for a valid id. A non-dictitem payload reached.getunguarded.Fix
Collect
(author, cleaned_text)pairs for children that actually render, stopping atcomment_limit, so the header, the numbering and the limit all describe the same set. A null or non-listchildrencoerces to[], and the item payload goes through the module's existing_safe_payload.Tests
Five regressions appended to the existing hermetic suite. No manifest change needed —
test_main.pyis already registered asomi-hacker-news-tests.test_deleted_comments_do_not_inflate_the_counttest_comment_limit_counts_printable_commentstest_all_deleted_comments_reports_none_rather_than_an_empty_listtest_null_children_is_not_reported_as_a_bad_item_idtest_non_dict_item_payload_does_not_crashAgainst
main: 4 failures and 5 errors. With the fix, all 15 tests pass.Orthogonal to #14283/#14284, which added
_safe_payload,item_idvalidation and_safe_limitbut left the children slice and the item payload untouched.Failure-Class: none
🤖 Generated with Claude Code