hakatime icon indicating copy to clipboard operation
hakatime copied to clipboard

`/projects` fails to load if there exists a project with a blank name

Open thehale opened this issue 2 years ago • 0 comments

Issue

When clicking on the Projects tab in the sidebar, my local instance of Hakatime sits on the loading screen forever.

Expected Behavior

Clicking on the Projects tab should pull up details about one of my projects, just like in the demo environment.

Steps to Reproduce

  1. Use VS Code on a random file, outside of any specific project, for a few minutes.
  2. Open Hakatime, log in, click on Projects and see the loading screen perpetually.

Suspected Root Cause

  • Looking in the Browser dev tools under Network I see a successful request to http://<my-hakatime-url>/api/v1/projects?start=2022-04-10T03%3A30%3A55.667Z&end=2022-04-25T03%3A30%3A55.667Z that returns my list of projects ["", "asu", "hakatime", "DIY-Supercube"].
  • Immediately after that successful request is a failed request to http://<my-hakatime-url>/api/v1/users/current/projects/?start=2022-04-10T03%3A30%3A55.667Z&end=2022-04-25T03%3A30%3A55.667Z&timeLimit=15 that returns a 404.

If I manually log into the hakatime db and delete all heartbeats with a blank project name, the page loads successfully.

Video for extra clarity:

https://user-images.githubusercontent.com/47901316/165017611-d62bb6ba-edb7-494d-8758-8231fa6ac93b.mp4

thehale avatar Apr 25 '22 03:04 thehale

same

JamesDAdams avatar Sep 16 '22 17:09 JamesDAdams

Thanks a lot @thehale for the detailed bug report. I was able to reproduce and fix the issue.

mujx avatar Sep 17 '22 11:09 mujx