Skip to content

View Users on a chart point returns nobody for weekly charts and for organizations outside UTC #654

Open

Description

@officialasishkumar

Description

On a time-series chart, clicking a point and choosing View Users often shows "No users found" while the chart shows a non-zero count for that point.

  • Weekly charts: every point comes back empty, in every timezone.
  • Organizations outside UTC: hour points come back empty, and day and month points match the wrong bucket (empty, or missing users near the edge of the period).

Steps to reproduce

  1. Open a report with a line chart and interval Week.
  2. Click any point with a count above 0 and choose View Users.
  3. The modal says "No users found".

For the timezone case, set the organization's timezone to America/New_York and do the same on an Hour chart.

Root cause

chartBucketProfilesQuery (packages/core/src/modules/chart/src/sql.ts, bucketEquals) doesn't match how the chart buckets its points:

  • The chart builds weeks with toStartOfWeek(created_at, 1, tz), so weeks start on Monday. The drill-down uses toStartOfWeek(toDateTime(created_at)), which uses mode 0, so weeks start on Sunday. A Sunday week start never equals the Monday date the chart sends back.
  • The chart runs with the organization's timezone as session_timezone. getChartBucketProfiles calls runQuery without a timezone, so the drill-down buckets in UTC while the point's date is in the organization's timezone.

Expected behavior

View Users returns the users behind the point, with the same count the chart shows, for every interval and timezone.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions