PostHog / posthog

đŸ¦” PostHog provides open-source web & product analytics, session recording, feature flagging and A/B testing that you can self-host. Get started - free.
https://posthog.com
Other
21.96k stars 1.32k forks source link

Bug: NPS survey type, Issue with Survey Explore Results. #25554

Open darkopia opened 1 month ago

darkopia commented 1 month ago

Bug Description

Bug description

When analysing a survey and clicking explore results, on a NPS survey type the embedded NPS insight becomes editable in the surveys screen and this cannot be undone without logging out

image

If you are on PostHog Cloud it would be really valuable if you can share any links where the problem occurs. This speeds up our ability to troubleshoot tremendously.

How to reproduce

  1. Have a NPS survey type with results
  2. Click explore results on any other survey (or the NPS survey)
  3. Navigate back to the NPS survey
  4. The embedded insight is now in edit mode

Additional context

Debug info

- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables or https://eu.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]
annikaschmid commented 2 weeks ago

@Phanatic This has been a long-standing bug, maybe you can have a look to see if this can be fixed easily.

Aashw1n commented 2 weeks ago

Hi @darkopia, @annikaschmid and @Phanatic

Seems like the embedded insight shows up in edit mode if a new insight is whipped up anywhere in the application (+ new insight in product analytics, open as insight in the web analytics section ,and the explore result button in survey results). Video below would demonstrate.

https://github.com/user-attachments/assets/dc0e55d9-e327-4d41-93c2-a642b7a982ba

After going through related code, seems like the Query component has a prop readOnly that fixes this issue when enabled, without affecting anything else.

I've opened a PR, and added relevant info. Please let me know if there's anything I'm missing, or if there's anything you'd like to see done differently.