diff --git a/packages/discovery-provider/integration_tests/tasks/entity_manager/test_comment.py b/packages/discovery-provider/integration_tests/tasks/entity_manager/test_comment.py index 487421495cc..3f97cee1ac2 100644 --- a/packages/discovery-provider/integration_tests/tasks/entity_manager/test_comment.py +++ b/packages/discovery-provider/integration_tests/tasks/entity_manager/test_comment.py @@ -799,7 +799,7 @@ def test_comment_reaction(app, mocker): reaction_entities = { **entities, - "comments": [{"comment_id": 1, "user_id": 2}], + "comments": [{"comment_id": 1, "user_id": 2, "entity_id": 1}], } tx_receipts = { diff --git a/packages/discovery-provider/src/tasks/entity_manager/entities/comment.py b/packages/discovery-provider/src/tasks/entity_manager/entities/comment.py index eba60a04928..05a243e0ae8 100644 --- a/packages/discovery-provider/src/tasks/entity_manager/entities/comment.py +++ b/packages/discovery-provider/src/tasks/entity_manager/entities/comment.py @@ -241,8 +241,11 @@ def create_comment(params: ManageEntityParameters): comment_id = params.entity_id # Only fan club posts can be members-only; track comments are never gated. + # Note: parse_metadata normalizes missing fields to None (not absent), so we can't + # rely on dict.get's default — we must explicitly treat None as "field omitted". + is_members_only_meta = metadata.get("is_members_only") is_members_only = ( - bool(metadata.get("is_members_only", True)) + (True if is_members_only_meta is None else bool(is_members_only_meta)) if entity_type == FAN_CLUB_ENTITY_TYPE else False )