Skip to content

Client error when defining Action trend #351

Closed

Description

@alex-ketch

Describe the bug
Attempting to define 'Action trends' on a new account results in errors, making it impossible(?) to create reports.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Trends' view
  2. See error in console
  3. Add an action filter
  4. No data graph is presented

Expected behavior

  1. Go to 'Trends' view
  2. Add an action filter
  3. See a graph of the results

Screenshots

Kapture 2020-03-13 at 10 04 46


Kapture 2020-03-13 at 9 44 26-314


Screen Shot 2020-03-13 at 09 31 14

Desktop (please complete the following information):

  • OS: macOS 10.15.3
  • Browser: Safari
  • Version: 13.0.5

Additional context

This is on the hosted PostHog instance.

Seems to be due to directly accessing the id the last actions.results item when the results list is empty (line 51).
Not familiar enough with the project to say whether that's a client or backend issue though.

fetchActions() {
api.get('api/action').then(actions => {
if (!this.state.filters.actions)
this.setFilters({
actions: [
{ id: actions.results[actions.results.length - 1].id },
],
})
this.setState({ actions: actions.results })
})
}

Activity

  1. added a commit that references this issue on Mar 13, 2020
    f1ab9a5
  2. added a commit that references this issue on Mar 13, 2020
    96b9a13
  3. timgl commented on Mar 13, 2020

    @timgl
    Collaborator

    @alex-ketch Thanks Alex, that is fixed. The reason for this is we normally load in some example actions, but that didn't happen with your account (due to the same issue that caused your token not to be set).

    Once you create an action, you should be on your way!

  4. added a commit that references this issue on Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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