Support activities with dates in the Unix timestamp format
Fixes #763 (closed)
Site https://juick.com sent activities with a published
field in the "Unix timestamp with milliseconds" format (1553808404.602961
) instead of ISO 8601. It caused an error in activity_view.ex
.
They claimed that they had changed the date format in the Jackson library (JSON library for Java Spring framework) settings, but I still got this error for some their activities.
Merge request reports
Activity
That's their fault,
published
should bexsd:dateTime
, not a unix timestamp per AS2 https://www.w3.org/TR/activitystreams-vocabulary/#dfn-published . I don't think we should support this off-spec implementationAlso it looks like they can actually return something that looks like a proper date format (the whole response is garbage tho):
$ curl -sSL -H 'Accept: application/ld+json,application/activity+json,application/json' 'https://juick.com/ma1uta/2938970' | jq . { "timestamp": "2019-04-01T21:24:29.474+0000", "status": 406, "error": "Not Acceptable", "message": "Not Acceptable", "path": "/ma1uta/2938970" }
I don't get why we should skip activities with wrong dates entirely. As @lambadalambda said, it's a warning.
Furthermore, we already handle dates in the wrong formats and return
""
for them. I expanded that logic to all possible inputs in 3db92351 and added logger warn message. Here is how it looks like in my logs:This seems alright actually. What do you think, @rinpatch ?
mentioned in commit 256b492a