I'm seeing this on My Projects page:
Untitled Project Last active Invalid date
/api/projects/ endpoint returned the following for this project:
/api/projects/
[ { "isPublic":true, "state":"STARTED", "desiredState":"STARTED", "reasonForState":"USER_ACTION", "saveState":"SAVED", "isForked":false, "id":"9r7y78cu", "userId":"b127815a-417c-412c-aeac-12598bbe4dad", "title":"Untitled Project", "description":null, "image":"registry.anyfiddle.com/projects/x4ku9su6", "port":null, "parentTemplateId":"nodejs", "parentProjectId":"x4ku9su6", "lastPingAt":null, "lastActiveAt":null, "lastStartedAt":"2020-09-03T23:35:14.000Z", "createdAt":"2020-09-03T23:35:05.839Z", "parentTemplate":{ } } ]
The good thing is that the frontend elegantly handled this backend error by translating "lastActiveAt": null to "Invalid date" instead of crashing. Call me irresponsible if I crash on null or undefined in JavaScript or TypeScript.
"lastActiveAt": null
Last active being null has a reason. Its not an error. UI will understand this.
It’s better to render as “Never” instead of “Invalid date”.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm seeing this on My Projects page:
/api/projects/
endpoint returned the following for this project:The good thing is that the frontend elegantly handled this backend error by translating
"lastActiveAt": null
to "Invalid date" instead of crashing. Call me irresponsible if I crash on null or undefined in JavaScript or TypeScript.Last active being null has a reason. Its not an error. UI will understand this.
It’s better to render as “Never” instead of “Invalid date”.