Skip to content

[Bug] Fetching custom dashboard files from an empty repo creates an error

Problem

When enabling custom Analytics Dashboards on a project with an empty repo the Project > Analytics > Dashboard pages throws an error.

Steps to reproduce

  1. Follow these instructions to set up Product Analytics in your GDK.
  2. Create a new project with an empty repository.
  3. Enable custom dashboards at Project > Settings > Analytics and pick the empty project.
  4. View the analytics dashboards at Project > Analytics > Dashboard.
  5. Observe the errors in your browser console.

Likely cause

The cause seems to be that /-/refs/[BRANCH]/logs_tree/ returns an HTML response when a project is empty is empty instead of an JSON encoded array.

Implementation plan

Update dashboards_api.js to filter out non-array responses.

Edited by Jiaan Louw