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

repro of insight logic issues #18256

Closed
wants to merge 3 commits into from
Closed

Conversation

thmsobrmlr
Copy link
Contributor

@thmsobrmlr thmsobrmlr commented Oct 29, 2023

Problem

This PR is a showcase/repro for some of the issue we have with insight logics. It's not meant to go in, ever.

Issue 1: Race condition between updates to date range and interval

  1. Navigate to localhost:8000/playground
  2. Change the date filter from "last 7 days" to "last 14 days"
  3. Observe that the query still does not have a dateRange, but an interval: "day" got added

Workaround:

  1. Add an early return to the updateQuerySource listener in intervalFilterLogic
  2. Perform the same steps as above
  3. Observe that now the dateRange gets updated (both in the insight and the playground query in the <pre />, NOT in the date filter itself - see below)

Issue 2: Dates not updating in connecting logic

  1. Observe that the date filter does not get updated when performing the steps above.

  2. In InsightDateFilter replace

    const {
      dates: { dateFrom, dateTo },
    } = useValues(insightDateFilterLogic(insightProps))

    with

    const { dateRange } = useValues(insightVizDataLogic)
    const dateTo = dateRange?.date_to
    const dateFrom = dateRange?.date_from
  3. Observe that the date filter now updates correctly

Issue 3/4: Display not updating in connecting logic; Race condition between updates to display and breakdown (when selecting world map display)

Basically the same thing as issue 1 and 2, just for the display filter.

Notes

All of this works on a regular insight page, just not when rendering a standalone <Query /> component. Ideas on what might cause this (I'm thinking I have checked these):

  • a key for a logic is missing/wrong and thus the connect doesn't work -> logging in logics show they are initialized with proper keys
  • the ordering of logics causing this -> logging order of initialization doesn't show anything suspicious / bringing them in the same order by manually mounting does not change the outcome

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

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

Successfully merging this pull request may close these issues.

2 participants