Fix two pre-existing failing comment indexer tests#14118
Open
dylanjeffers wants to merge 1 commit intomainfrom
Open
Fix two pre-existing failing comment indexer tests#14118dylanjeffers wants to merge 1 commit intomainfrom
dylanjeffers wants to merge 1 commit intomainfrom
Conversation
test_comment_reaction: the test seeded a Comment row via populate_mock_db
with only {comment_id, user_id}, causing populate_mock_db's default
entity_id=i (loop index 0) to be stored. react_comment then looked up
TRACK[0] in existing_records and blew up with KeyError: 0. Pin the seeded
comment to entity_id=1 so it matches the track referenced by the React tx.
test_fan_club_comment_is_members_only_default: parse_metadata runs incoming
payloads through get_metadata_from_json, which populates every key in
comment_metadata_format. Missing fields become literal None values instead
of being absent, so metadata.get("is_members_only", True) returned None
(key present) rather than the True default. Fan-club comments that omit
is_members_only ended up with False. Explicitly treat None as "omitted"
and default to True for fan-club comments.
Co-Authored-By: Claude Opus 4.6 (1M context) <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.
test_comment_reaction: the test seeded a Comment row via populate_mock_db with only {comment_id, user_id}, causing populate_mock_db's default entity_id=i (loop index 0) to be stored. react_comment then looked up TRACK[0] in existing_records and blew up with KeyError: 0. Pin the seeded comment to entity_id=1 so it matches the track referenced by the React tx.
test_fan_club_comment_is_members_only_default: parse_metadata runs incoming payloads through get_metadata_from_json, which populates every key in comment_metadata_format. Missing fields become literal None values instead of being absent, so metadata.get("is_members_only", True) returned None (key present) rather than the True default. Fan-club comments that omit is_members_only ended up with False. Explicitly treat None as "omitted" and default to True for fan-club comments.