Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API event targeting surveys should call getActiveMatchingSurveys callback when conditions are met #1498

Open
BrunnerLivio opened this issue Oct 24, 2024 · 0 comments

Comments

@BrunnerLivio
Copy link

BrunnerLivio commented Oct 24, 2024

Description

I have created an API survey with the Display Conditions: User sends events -> my_event.

Given the following example

posthog.getActiveMatchingSurveys(console.log)
setTimeout(() => posthog.capture('my_event'), 1000)

Expected behavior

I'd expect the following console output:

[]
[{ "type": "api", "id": "...",... }]

Current behavior

The actual console output:

[]

Given the code snippet above, if posthog.getActiveMatchingSurveys(console.log) is executed again, the
callback receives the expected argument

[{ "type": "api", "id": "...",... }]

Though I am looking for a push-based mechanism from getActiveMatchingSurveys rather than a pull-based, as shown in the "Expected Behavior"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant