n1k0 / tooty

An alternative multi-accounts Web client for Mastodon.
https://n1k0.github.io/tooty/v2/
155 stars 9 forks source link

Check GoToSocial compatibity #256

Open vjousse opened 2 months ago

vjousse commented 2 months ago

Issue created from https://github.com/n1k0/tooty/issues/255

I am able to log in and authorize the app (Tooty), but now I get an orange popup with the header HTTP 200 : Failed decoding JSON: followed by a very large array in JSON format which appears to be a Fediverse timeline. I would provide a pastebin, but apparently it contains NSFW content. At the bottom of this long JSON document it says Expecting null. I suspect this may be a problem with GoToSocial, which perhaps encodes JSON in some way that is incompatible with Tooty.

Works perfectly with my Mastodon account, though. My compliments to the chef!

vjousse commented 2 months ago

First encountered error is Expecting an OBJECT with a field named edited_at

For url https://cambrian.social/api/v1/timelines/public?local=true&limit=60

{
  "id": "01HWRRWYV739R3GG41NDQEYZ86",
  "created_at": "2024-05-01T00:29:32.391Z",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": "en",
  "uri": "https://cambrian.social/users/lori/statuses/01HWRRWYV739R3GG41NDQEYZ86",
  "url": "https://cambrian.social/@lori/statuses/01HWRRWYV739R3GG41NDQEYZ86",
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "content": "<p>This is a test.</p>",
  "reblog": null,
  "application": {
    "name": "Tooty",
    "website": "https://github.com/n1k0/tooty"
  },
  "account": {
    "id": "01BTW7DM7CQ9CZDJ160E2DH0R4",
    "username": "lori",
    "acct": "lori",
    "display_name": "lori",
    "locked": true,
    "discoverable": true,
    "bot": false,
    "created_at": "2024-04-19T16:18:35.000Z",
    "note": "",
    "url": "https://cambrian.social/@lori",
    "avatar": "https://cambrian.social/fileserver/01BTW7DM7CQ9CZDJ160E2DH0R4/attachment/original/01HVVK35P1ZT84ZNFSPYKZ4JPW.jpg",
    "avatar_static": "https://cambrian.social/fileserver/01BTW7DM7CQ9CZDJ160E2DH0R4/attachment/small/01HVVK35P1ZT84ZNFSPYKZ4JPW.jpg",
    "header": "https://cambrian.social/fileserver/01BTW7DM7CQ9CZDJ160E2DH0R4/attachment/original/01HVVK35VGX8TSNBFJ7WMAT8BZ.jpg",
    "header_static": "https://cambrian.social/fileserver/01BTW7DM7CQ9CZDJ160E2DH0R4/attachment/small/01HVVK35VGX8TSNBFJ7WMAT8BZ.jpg",
    "followers_count": 249,
    "following_count": 612,
    "statuses_count": 137,
    "last_status_at": "2024-05-02T02:54:22.000Z",
    "emojis": [],
    "fields": [
      {
        "name": "Neocities",
        "value": "<a href=\"https://n8chz.neocities.org/\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">https://n8chz.neocities.org/</a>",
        "verified_at": null
      },
      {
        "name": "Blog",
        "value": "<a href=\"https://astoundingteam.com/wordpress/\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">https://astoundingteam.com/wordpress/</a>",
        "verified_at": null
      },
      {
        "name": "Mastodon",
        "value": "<a href=\"https://queer.party/@n8chz\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">https://queer.party/@n8chz</a>",
        "verified_at": null
      },
      {
        "name": "Codeberg",
        "value": "<a href=\"https://codeberg.org/n8chz\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">https://codeberg.org/n8chz</a>",
        "verified_at": null
      },
      {
        "name": "NAO",
        "value": "<a href=\"https://nethackscoreboard.org/players/S/Shruner.nh.html\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">https://nethackscoreboard.org/players/S/Shruner.nh.html</a>",
        "verified_at": null
      },
      {
        "name": "Alibris wish list",
        "value": "<a href=\"https://www.alibris.com/wishlist/14684885/JV3B7ES13ZHD9OR8H6W5\" rel=\"nofollow noreferrer noopener\" target=\"_blank\">https://www.alibris.com/wishlist/14684885/JV3B7ES13ZHD9OR8H6W5</a>",
        "verified_at": null
      }
    ],
    "enable_rss": true,
    "role": {
      "name": "admin"
    }
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "card": null,
  "poll": null,
  "text": "This is a test."
}
vjousse commented 2 months ago

Ok it looks like it was the edited_at field that should have been optional. It's working on the local timeline that don't use websockets.

Screenshot 2024-05-02 at 18-14-06 Tooty

For the other timelines, websockets are used and Tooty is unable to connect to you server using websockets. Are you sure everything is setup as it should on your side? Cf https://docs.gotosocial.org/en/latest/getting_started/reverse_proxy/websocket/