Skip to content

Fix two pre-existing failing comment indexer tests#14118

Open
dylanjeffers wants to merge 1 commit intomainfrom
fix-pre-existing-comment-tests
Open

Fix two pre-existing failing comment indexer tests#14118
dylanjeffers wants to merge 1 commit intomainfrom
fix-pre-existing-comment-tests

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

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.

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>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

⚠️ No Changeset found

Latest commit: 9521680

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant