Hello to anyone who can help.
I have completed (I thought) the exercise tracker challenge. I do not pass test 5 and 6 due to a timed out
error. However, it seems to work just fine for me using both the form and postman to send an api GET request.
It’s hosted on heroku here: https://exercism-app.herokuapp.com/
The code is on GitHub here: https://github.com/Grrrotbag/exercism
Does anyone have any idea what I am doing wrong?
Edit: I tell a lie - It works on my local installation but I get an error from the Heroku installation as such:
2021-01-19T13:12:36.243686+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/exercise/log?userId=600624a4b3663a4d8c7cd5e5" host=exercism-app.herokuapp.com request_id=bb7b81d3-45f8-40cb-b41c-d411d2729225 fwd="81.155.118.196" dyno= connect= service= status=503 bytes= protocol=https
Further Edit: I have restarted my Heroku installation and it is working again. So still in the same boat as before, tests 5 and 6 time out but I can get the desired result either using the url in browser, or through postman.
FINAL EDIT: I’m pleased to say I have worked this out:
The test says - “You can make a GET
request to /api/exercise/log
with a parameter of userId=_id
to retrieve a full exercise log of any user. The returned response will be the user object with a log
array of all the exercises added. Each log item has the description
, duration
, and date
properties.”
Strangely, this was not the actual issue. Examining the herkou log showed that what was actually timing out was a POST request to /api/exercise/add
. After some extra console.logs, I find that the issue was with the possibility of an invalid date being supplied. A better check for a valid date, and a fallback to today. and the project now passes.
Hopefully this might help someone in the future.