dahlia / hollo

Federated single-user microblogging software
https://docs.hollo.social/
GNU Affero General Public License v3.0
238 stars 16 forks source link

Missing URL for Misskey and Akkoma posts #58

Closed aliceif closed 3 weeks ago

aliceif commented 3 weeks ago

(Hollo version in use: 0.2.0) In the database, posts from Misskey, Sharkey and Akkoma have empty url fields in the posts table. This causes things like "copy link to post" or "open source url" in various clients to not work.

According to fedify cli, there seems to also be no url field in the status objects as emitted by Misskey or Akkoma.

ThisIsMissEm commented 3 weeks ago

I think this is a bit of a misskey/akkoma-ism, I suspect they only distribute the URI / ID for the object, not the URL, though someone would have to confirm.

dahlia commented 3 weeks ago

According to fedify cli, there seems to also be no url field in the status objects as emitted by Misskey or Akkoma.

Could you provide some examples? IIRC Misskey provides a url property for Notes.

aliceif commented 3 weeks ago

https://misskey.io/notes/9zdjwem4zvdt003m

as output by fedify lookup -r

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1",
    {
      "Key": "sec:Key",
      "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
      "sensitive": "as:sensitive",
      "Hashtag": "as:Hashtag",
      "quoteUrl": "as:quoteUrl",
      "toot": "http://joinmastodon.org/ns#",
      "Emoji": "toot:Emoji",
      "featured": "toot:featured",
      "discoverable": "toot:discoverable",
      "schema": "http://schema.org#",
      "PropertyValue": "schema:PropertyValue",
      "value": "schema:value",
      "misskey": "https://misskey-hub.net/ns#",
      "_misskey_content": "misskey:_misskey_content",
      "_misskey_quote": "misskey:_misskey_quote",
      "_misskey_reaction": "misskey:_misskey_reaction",
      "_misskey_votes": "misskey:_misskey_votes",
      "_misskey_summary": "misskey:_misskey_summary",
      "isCat": "misskey:isCat",
      "vcard": "http://www.w3.org/2006/vcard/ns#"
    }
  ],
  "id": "https://misskey.io/notes/9zdjwem4zvdt003m",
  "type": "Note",
  "attributedTo": "https://misskey.io/users/7rkrarq81i",
  "content": "<p>​:ai_blink_nod:​<b>Misskey 2024.10.1</b>がリリースされました​:ai_blink_nod:​<span><br><br>タイムライン 表示時のパフォーマンス改善、スパム対策、バグ修正などが含まれます</span>​:cyber_hacking:​<span><br>ぜひアップデートをお願いします</span>​:blob_bongo_cat_keyboard:​<span><br><br>詳しくは</span><a href=\"https://misskey-hub.net/ja/docs/releases/#_2024101\">リリースノート</a><span>をご確認ください。<br><br>開発に貢献してくださった方々、ベータ版をテストしてくださった方々、翻訳をしてくださった方々、いつも支援してくださっている方々へ感謝を申し上げます</span>​:arigunyatogonyainyasu:​<span><br><br>これからも開発を続けられるようぜひMisskey Projectにご支援お願いいたします</span>​:ai_wave:​<span><br></span><a href=\"https://misskey-hub.net/ja/docs/donate/\">https://misskey-hub.net/ja/docs/donate/</a></p>",
  "_misskey_content": ":ai_blink_nod:**Misskey 2024.10.1**がリリースされました:ai_blink_nod:\n\nタイムライン表示時のパフォーマンス改善、スパム対策、バグ修正などが含まれます:cyber_hacking:\nぜひアップデートをお願いします:blob_bongo_cat_keyboard:\n\n詳しくは?[リリースノート](https://misskey-hub.net/ja/docs/releases/#_2024101)をご確認ください。\n\n開発に貢献し てくださった方々、ベータ版をテストしてくださった方々、翻訳をしてくださった方々、いつも支援してくださっている方々へ感謝を申し上げます:arigunyatogonyainyasu:\n\nこれからも開発を続けられるようぜひMisskey Projectにご支援お願いいたします:ai_wave:\nhttps://misskey-hub.net/ja/docs/donate/",
  "source": {
    "content": ":ai_blink_nod:**Misskey 2024.10.1**がリリースされました:ai_blink_nod:\n\nタイムライン表示時のパフォーマ ンス改善、スパム対策、バグ修正などが含まれます:cyber_hacking:\nぜひアップデートをお願いします:blob_bongo_cat_keyboard:\n\n詳しくは?[リリースノート](https://misskey-hub.net/ja/docs/releases/#_2024101)をご確認ください。\n\n開発に貢献してくだ さった方々、ベータ版をテストしてくださった方々、翻訳をしてくださった方々、いつも支援してくださっている方々へ感謝を申し上げます:arigunyatogonyainyasu:\n\nこれからも開発を続けられるようぜひMisskey Projectにご支援お願いいたします:ai_wave:\nhttps://misskey-hub.net/ja/docs/donate/",
    "mediaType": "text/x.misskeymarkdown"
  },
  "published": "2024-10-15T05:12:23.548Z",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public"
  ],
  "cc": [
    "https://misskey.io/users/7rkrarq81i/followers"
  ],
  "inReplyTo": null,
  "attachment": [
    {
      "type": "Document",
      "mediaType": "image/webp",
      "url": "https://media.misskeyusercontent.com/io/65fb768e-873b-467c-9935-13eb0f6f116a.webp",
      "name": null,
      "sensitive": false
    }
  ],
  "sensitive": false,
  "tag": [
    {
      "id": "https://misskey.io/emojis/ai_blink_nod",
      "type": "Emoji",
      "name": ":ai_blink_nod:",
      "updated": "2023-10-29T23:29:43.471Z",
      "icon": {
        "type": "Image",
        "mediaType": "image/gif",
        "url": "https://media.misskeyusercontent.com/misskey/eb3648f2-fb4f-47b1-9d63-e5de673dba94.gif"
      }
    },
    {
      "id": "https://misskey.io/emojis/cyber_hacking",
      "type": "Emoji",
      "name": ":cyber_hacking:",
      "updated": "2022-01-27T03:05:34.376Z",
      "icon": {
        "type": "Image",
        "mediaType": "image/gif",
        "url": "https://media.misskeyusercontent.com/emoji/cyber_hacking.gif"
      }
    },
    {
      "id": "https://misskey.io/emojis/blob_bongo_cat_keyboard",
      "type": "Emoji",
      "name": ":blob_bongo_cat_keyboard:",
      "updated": "2023-11-04T20:46:39.936Z",
      "icon": {
        "type": "Image",
        "mediaType": "image/gif",
        "url": "https://media.misskeyusercontent.com/emoji/blob_bongo_cat_keyboard.gif"
      }
    },
    {
      "id": "https://misskey.io/emojis/arigunyatogonyainyasu",
      "type": "Emoji",
      "name": ":arigunyatogonyainyasu:",
      "updated": "2023-04-28T23:52:36.001Z",
      "icon": {
        "type": "Image",
        "mediaType": "image/png",
        "url": "https://media.misskeyusercontent.com/emoji/arigunyatogonyainyasu.png"
      }
    },
    {
      "id": "https://misskey.io/emojis/ai_wave",
      "type": "Emoji",
      "name": ":ai_wave:",
      "updated": "2023-10-29T23:29:43.471Z",
      "icon": {
        "type": "Image",
        "mediaType": "image/apng",
        "url": "https://media.misskeyusercontent.com/misskey/0508a9b2-7826-4aab-bfcd-bd94973e7b02.png"
      }
    }
  ]
}

database row:

hollo=#  select * from posts where iri= 'https://misskey.io/notes/9zdjwem4zvdt003m';
-[ RECORD 1 ]---+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
id              | 01928e97-74fc-7fdc-828b-cd67ad3390ae
iri             | https://misskey.io/notes/9zdjwem4zvdt003m
type            | Note
actor_id        | 0192d53f-d7e6-7a31-97fc-7e281d3a0e6a
application_id  |
reply_target_id |
sharing_id      |
visibility      | public
content_html    | <p>​:ai_blink_nod:​<b>Misskey 2024.10.1</b>がリリースされました​:ai_blink_nod:​<span><br><br>タイムラ イン表示時のパフォーマンス改善、スパム対策、バグ修正などが含まれます</span>​:cyber_hacking:​<span><br>ぜひアップデートをお願いします</span>​:blob_bongo_cat_keyboard:​<span><br><br>詳しくは</span><a href="https://misskey-hub.net/ja/docs/releases/#_2024101">リリースノート</a><span>をご確認ください。<br><br>開発に貢献してくださった方々、ベータ版をテストしてくださった方々、翻訳をしてくださった方々、いつも支援してくださっている方々へ感謝を申し上げます</span>​:arigunyatogonyainyasu:​<span><br><br>これからも開発を続けられるようぜひMisskey Projectにご支援お願いいたします</span>​:ai_wave:​<span><br></span><a href="https://misskey-hub.net/ja/docs/donate/">https://misskey-hub.net/ja/docs/donate/</a></p>
language        |
tags            | {}
sensitive       | f
url             |
replies_count   | 0
shares_count    | 0
likes_count     | 0
published       | 2024-10-15 05:12:23.548+00
updated         | 2024-10-15 05:12:23.548+00
preview_card    | "{\"url\":\"https://misskey-hub.net/docs/donate//\",\"title\":\"プロジェクトへの寄付 | Misskey Hub\",\"description\":\"【ノートでひろがるネットワーク】分散型SNS Misskeyの公式サイト。Misskeyのはじめかたやサーバー一覧など、Misskeyに関する情報が満載!\",\"image\":{\"url\":\"https://misskey-hub.net/img/og/misskey-hub-screenshot-l.png\",\"type\":\"png\",\"width\":null,\"height\":null}}"
summary         |
content         |
poll_id         |
quote_target_id |
emojis          | {":ai_wave:": "https://media.misskeyusercontent.com/misskey/0508a9b2-7826-4aab-bfcd-bd94973e7b02.png", ":ai_blink_nod:": "https://media.misskeyusercontent.com/misskey/eb3648f2-fb4f-47b1-9d63-e5de673dba94.gif", ":cyber_hacking:": "https://media.misskeyusercontent.com/emoji/cyber_hacking.gif", ":arigunyatogonyainyasu:": "https://media.misskeyusercontent.com/emoji/arigunyatogonyainyasu.png", ":blob_bongo_cat_keyboard:": "https://media.misskeyusercontent.com/emoji/blob_bongo_cat_keyboard.gif"}
idempotence_key |

This also applies to posts from other instances.

Fresh new post: https://mkultra.x27.one/notes/a065u9iqky

dahlia commented 3 weeks ago

Hmm… okay, we should use posts.iri when there's no posts.url then.

dahlia commented 3 weeks ago

Fixed in 0.1.7 and 0.2.1.