hakatime
hakatime copied to clipboard
`/projects` fails to load if there exists a project with a blank name
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
- Use VS Code on a random file, outside of any specific project, for a few minutes.
- 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
same
Thanks a lot @thehale for the detailed bug report. I was able to reproduce and fix the issue.