Role conditions don't work as expected (OR) if multiple roles are selected

Created on 12 February 2025, 3 months ago

Problem/Motivation

Selecting

  • Anonymous user
  • Authenticated user

as role conditions in posthog_js you'd expect them to be both allowed (OR), but currently seems to work in a way that both roles have to apply to the same user at the same time, which is not possible.

The strange thing is, that it works correctly for blocks.

Maybe the "and" condition (has no UI yet) is incorrect here. My assumption was, that it's on the top level. That would still make most sense to me, but this is my first guess for the reason.

Please test carefully if the MR fixes it. First ensure you can reproduce the issue! Using posthog_cookies you get an error in console with this selection on pages that should track with posthog!

Uncaught TypeError: Cannot read properties of undefined (reading 'api_key')

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code (posthog_js)

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024