Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Following: posts and boosts from accounts I follow do not appear in third-party app's main request #168

Open
jeherve opened this issue Aug 13, 2024 · 6 comments · Fixed by #193

Comments

@jeherve
Copy link
Contributor

jeherve commented Aug 13, 2024

When I installed this plugin, alongside Friends and ActivityPub, I expected posts from Fediverse accounts I follow (either by entering their handle in Friends' wp-admin settings or by hitting Follow in a third-party app) to appear in my timeline in third-party apps.

However, the api/v1/timelines/home endpoint the third-party application (Semaphore, for example) seems to call does not return posts from folks I follow. It returns activity from my site.

I do see posts from people I follow in the /friends/ page on my site, though.

How could I debug this further?

@jeherve
Copy link
Contributor Author

jeherve commented Aug 13, 2024

does not return posts from folks I follow. It returns activity from my site.

Looking into this further, here is an example of an item returned by the endpoint:

First item returned in the JSON response
{
	"id": "736",
	"created_at": "2024-08-13T06:26:20.000Z",
	"spoiler_text": "",
	"visibility": "public",
	"uri": "https://herve.bzh/?enable-mastodon-apps=reblog-of-731",
	"content": "Reblog of 731",
	"url": null,
	"language": null,
	"in_reply_to_id": null,
	"in_reply_to_account_id": null,
	"text": null,
	"edited_at": null,
	"sensitive": false,
	"favourited": false,
	"reblogged": false,
	"muted": false,
	"bookmarked": false,
	"pinned": false,
	"filtered": [],
	"media_attachments": [],
	"mentions": [],
	"tags": [],
	"emojis": [],
	"replies_count": 0,
	"reblogs_count": 0,
	"favourites_count": 0,
	"card": null,
	"poll": null,
	"account": {
		"id": "0",
		"username": "",
		"acct": "jeremy",
		"url": "https://herve.bzh/friends//",
		"display_name": "",
		"note": "<p>WordPress, TV Series, music, kids, and board games. I think that's probably the best way to define me in a few words. 🙂</p>\n<p>I work at Automattic on the Jetpack plugin and its infrastructure. You'll consequently find me talking about WordPress things a lot, but also about all things open source in general.</p>\n<p>I am French and live in Brittany, so I will post in French from time to time, as well as share pictures of our beautiful Brittany. 🙂</p>\n",
		"avatar": "",
		"avatar_static": "",
		"header": "",
		"header_static": "",
		"locked": false,
		"bot": false,
		"group": false,
		"discoverable": true,
		"noindex": false,
		"suspended": false,
		"limited": false,
		"statuses_count": 101,
		"followers_count": 20,
		"following_count": 0,
		"source": {
			"privacy": "public",
			"sensitive": false,
			"language": "fr_FR",
			"note": "",
			"fields": []
		},
		"fields": [
			{
				"name": "Blog",
				"value": "<p><a rel=\"me noopener\" title=\"https://herve.bzh/\" target=\"_blank\" href=\"https://herve.bzh/\">herve.bzh</a></p>"
			},
			{
				"name": "Profil",
				"value": "<p><a rel=\"me noopener\" title=\"https://herve.bzh/author/jeremy/\" target=\"_blank\" href=\"https://herve.bzh/author/jeremy/\">herve.bzh</a></p>"
			},
			{
				"name": "Homepage",
				"value": "<p><a rel=\"me noopener\" title=\"https://jeremy.hu/\" target=\"_blank\" href=\"https://jeremy.hu/\">jeremy.hu</a></p>"
			},
			{
				"name": "My other Fediverse account",
				"value": "<p><a href=\"https://fedi.jeremy.hu/@jeremy\">@[email protected]</a></p><p></p>"
			}
		],
		"emojis": [],
		"created_at": "2024-08-13T08:56:37.000Z",
		"last_status_at": "2024-08-13"
	},
	"reblog": null
},

At first, I thought this was a boost of one of my posts. However, I was wrong. When I click on that first item, I see this in my client:

image

However, in parallel the client does a request to https://herve.bzh/api/v1/statuses/736 to fetch that specific item, and it returns the following:

{
  "id": "736",
  "created_at": "2024-08-13T06:26:20.000Z",
  "spoiler_text": "",
  "visibility": "public",
  "uri": "https://hci.social/@juliagersey/112951946184373958",
  "content": "<p>Switching over from Twitter today…\u2029👋🏻 I’m Julia, an incoming ECE PhD student at the University of Michigan. My research focuses on using embedded sensing systems to help communities &amp; the environment. 2 weeks til classes start! <br />\u2029<a href=\"https://hci.social/tags/academia\" class=\"mention hashtag\" rel=\"tag\">#<span>academia</span></a> <a href=\"https://hci.social/tags/phd\" class=\"mention hashtag\" rel=\"tag\">#<span>phd</span></a></p>",
  "url": null,
  "language": null,
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "text": null,
  "edited_at": null,
  "sensitive": false,
  "favourited": false,
  "reblogged": false,
  "muted": false,
  "bookmarked": false,
  "pinned": false,
  "filtered": [],
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "card": null,
  "poll": null,
  "account": {
    "id": "10000000202",
    "username": "juliagersey",
    "acct": "jeremy",
    "url": "https://hci.social/users/juliagersey",
    "display_name": "juliagersey",
    "note": "<p>WordPress, TV Series, music, kids, and board games. I think that's probably the best way to define me in a few words. 🙂</p>\n<p>I work at Automattic on the Jetpack plugin and its infrastructure. You'll consequently find me talking about WordPress things a lot, but also about all things open source in general.</p>\n<p>I am French and live in Brittany, so I will post in French from time to time, as well as share pictures of our beautiful Brittany. 🙂</p>\n",
    "avatar": "https://storage.googleapis.com/hci-social-storage/accounts/avatars/112/951/262/199/494/207/original/9e93d8976bccd7fc.png",
    "avatar_static": "https://storage.googleapis.com/hci-social-storage/accounts/avatars/112/951/262/199/494/207/original/9e93d8976bccd7fc.png",
    "header": "https://files.mastodon.social/media_attachments/files/003/134/405/original/04060b07ddf7bb0b.png",
    "header_static": "https://files.mastodon.social/media_attachments/files/003/134/405/original/04060b07ddf7bb0b.png",
    "locked": false,
    "bot": false,
    "group": false,
    "discoverable": true,
    "noindex": false,
    "suspended": false,
    "limited": false,
    "statuses_count": 28,
    "followers_count": 20,
    "following_count": 0,
    "source": {
      "privacy": "public",
      "sensitive": false,
      "language": "fr_FR",
      "note": "<p>CTO, founder of <span class=\"h-card\" translate=\"no\"><a href=\"https://mementomori.social/@dude\" class=\"u-url mention\">@<span>dude</span></a></span>, admin of many servers like this one. Web developer, CSS wizard, *nix user, an advocate for open and ethical Internet. Creator of the Mastodon Bird UI. I do WordPress and open source for a living.</p>",
      "fields": []
    },
    "fields": [
      {
        "name": "Blog",
        "value": "<p><a rel=\"me noopener\" title=\"https://herve.bzh/\" target=\"_blank\" href=\"https://herve.bzh/\">herve.bzh</a></p>"
      },
      {
        "name": "Profil",
        "value": "<p><a rel=\"me noopener\" title=\"https://herve.bzh/author/jeremy/\" target=\"_blank\" href=\"https://herve.bzh/author/jeremy/\">herve.bzh</a></p>"
      },
      {
        "name": "Homepage",
        "value": "<p><a rel=\"me noopener\" title=\"https://jeremy.hu/\" target=\"_blank\" href=\"https://jeremy.hu/\">jeremy.hu</a></p>"
      },
      {
        "name": "My other Fediverse account",
        "value": "<p><a href=\"https://fedi.jeremy.hu/@jeremy\">@[email protected]</a></p><p></p>"
      }
    ],
    "emojis": [],
    "created_at": "2024-08-12T15:44:26.000Z",
    "last_status_at": "2024-08-13"
  },
  "reblog": null
}

The content is more interesting here ; I get the actual content of the post. It appears to be a post from someone I do not follow, but I see that that post was boosted by someone I follow ; this is how it got into my timeline.

When I hit return in my client, the post content has been replaced from Reblog of 731 to the correct information:

image

If I keep clicking on each "Reblog of" item, each post appears.

  • Would it be possible for the posts' content to appear right away, in the api/v1/timelines/home request?
  • Would it be possible for the posts to be displayed as boosts, so I can understand why they're in my timeline?
  • Some of the content in the api/v1/statuses/736 call doesn't seem correct. account.acct, account.note, account.source.language seem to return info about my own instance, maybe others.

@akirk
Copy link
Owner

akirk commented Aug 13, 2024

Thanks for the debugging, I think you made some important findings there. The home timeline and the status should go through the same filters, I think I haven't tested the case for your own reblogs yet.
So would you say the original issue remains like you put it or is the issue most about your own reblog?

@jeherve jeherve changed the title Following: posts from accounts I follow do not appear in third-party apps Following: posts and boosts from accounts I follow do not appear in third-party app's main request Aug 13, 2024
@jeherve
Copy link
Contributor Author

jeherve commented Aug 13, 2024

I think I haven't tested the case for your own reblogs yet.

To clarify, these are not my own reblogs. They're posts that people I follow have boosted.

So would you say the original issue remains like you put it or is the issue most about your own reblog?

I adjusted the title a bit, hopefully to make that clearer.

@pfefferle
Copy link
Collaborator

I am not sure if the Friends plugin supports boosts and likes, but ActivityPub does not (yet). We are currently implementing it behind a feature flag.

@akirk
Copy link
Owner

akirk commented Aug 13, 2024

Ok, I think I understand this better now. For the statuses/id endpoint, it does an ActivityPub request to the remote server, for the home timeline it doesn't but it would be too costly to do this for each item in the timeline. So I suppose the best way to solve this is in the Friends plugin to fetch this additional information already when the Reblog is received.

@jeherve
Copy link
Contributor Author

jeherve commented Feb 17, 2025

@akirk I think it may be worth reopening this issue because athough I now don't see boosts anymore in my timeline, I still do not see posts from folks I follow via the Friends plugin. The api/v1/timelines/home?limit=20 call only returns my own posts as well as comments on my posts.

Image

I'm happy to debug this further if you need more info. It may only be happening to me if this hasn't been reporting by others until now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants