Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.0
-
None
-
Unknown
-
Description
Problem
Once accepted by Mastodon, a message sent from XWiki is never displayed on the Mastodon side: Mastodon fails while processing the received activity:
undefined method 'to_datetime' for an instance of Integer (NoMethodError)
datetime = @object['published']&.to_datetime
Cause
Dates (published, updated...) are serialized as epoch milliseconds, e.g. "published" : 1785046974031. The ActivityStreams vocabulary types them as xsd:dateTime, so receivers expect an ISO-8601 string such as "published" : "2026-07-26T06:33:47.000+00:00".
Fix
Serialize the dates as ISO-8601 strings. Dates given as epoch milliseconds are still accepted when parsing, so the entities already stored in the old format remain readable.
Reproduced with Mastodon 4.6.3.