Uploaded image for project: 'ActivityPub Application'
  1. ActivityPub Application
  2. XAP-115

Dates of the sent activities are serialized as timestamps instead of ISO-8601 strings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.7.12
    • 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.

      Attachments

        Activity

          People

            mleduc Manuel Leduc
            mleduc Manuel Leduc
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: