Skip to main content


@Friendica Support

While I did some searching with friendicas fulltext search and tag search I noticed that there are many top-level posts from diaspora users in my stream. So I looked in the db. And I noticed that I'm the only person on my instance who does have connections with diaspora users (and this two contacts are not real diaspora contacts. They are hubzilla contacts.)
Social relay is disabled.

So why do I have that many top-level posts from diaspora users who no one knows?

SELECT COUNT( `a`.`id`) AS `total` 
FROM `item` a 
LEFT JOIN `item` `b` ON `a`.`id` = `b`.`id` 
INNER JOIN `contact` ON `a`.`contact-id` = `contact`.`id` 
WHERE `a`.`id` = `b`.`parent` AND `contact`.`uid` = 0 AND `contact`.`network` = 'dspr'

-
total
------
1867
Have you enabled the relay?
No I haven't enabled it. Maybe I did some experiments some time ago but at the moment it is disabled
How old are the posts?
Weren't this posts reposted by some of your contacts?
From 2016-08-31 till 2017-02-10 (date of receive)
But posts were automatically deleted after 180 days
maybe. But I haven't ever seen the content of this messages in any shared posts I got (and at the moment I am the only active member on my instance).

I have ca. 376 public top level post on my instance from friendica members with uid=0 (in the contact table) but for diaspora there are 1902 top level posts
I guess something with the relay server is the root of the issue. I can not imagine that such a amount of messages (150 posts since i wrote the initial post above) come from somewhere else.
You may want to check your webserver log to see if you received data from the relays (it's pretty explicit).
edit : user agent for the relay is "Social-Relay/1.3.1 - https://github.com/jaywink/social-relay"
the logs does have some lines like
209.240.111.146 - - [10/Feb/2017:16:38:58 +0100] "GET /.well-known/x-social-relay HTTP/1.1" 200 6082 "-" "Social-Relay/1.3.1 - https://github.com/jaywink/social-relay" 


But this shouldn't be problematically since https://friendica.kommune4.de/.well_known/x-social-relay does say "subscribe": false,
My last public dspr post I received is from today 12:31.
In the webserver log says
130.180.122.122 - - [10/Feb/2017:12:31:02 +0100] "POST /receive/public HTTP/1.1" 200 5704 "-" "DiasporaFederation/0.1.7"
I just checked the Diaspora code. Every post that your server receives will be stored with uid=0.
Yes it is but why is it sent to his server anyway?
This is a good question.
I don't really know how the relay server does work but isn't this behavior a little bit risky? I just think about a manipulated diaspora server which is sending public posts to small friendica instances. If every friendica instance is accepting every public diaspora post it can be used to get a small server down.

But the other question is why do I get that much public posts? subscribe is set to false in .well_known/x-social-relay

The ideal behavior for me would be. Federating my public posts to the social relay but don't receive public posts from the relay (because at the moment I'm not interested in any public posts from diaspora or other networks)
Give me a second for a pull request.
No hurry. You have just arrived ;-)

I just want to analyze where the problems are.
The question is also if the problem is only on our side. Shouldn't the relay server stop relaying post to instance with subscribe: false?
Pull request is ready. Now its testing time.
Damned waste of time typing on a phone, I hope I'll be more helpful tomorrow... Good night all!
The relay won't start sending public posts until you have subscribed to it. If you don't have POST requests from the relays but from other diaspora server it may be because some of their user "share with you", with means that their posts will be sent to your server. Maybe their contact request failed to be dealt with correctly by your server...

From how many users are the public posts you receive with "uid=0" ?
SELECT COUNT(DISTINCT `contact`.`nurl`) FROM `item` `a` LEFT JOIN `item` `b` ON `a`.`id` = `b`.`id` INNER JOIN `contact` ON `a`.`contact-id` = `contact`.`id` WHERE `a`.`id` = `b`.`parent` AND `contact`.`uid` = 0 AND `contact`.`network` = 'dspr'

Result 373 Persons from diaspora with uid=0 who have public top-level-posts on my instance
OK I'm not totally sure. After some tests I guess this public posts come from diaspora persons who does have a pending contact requests or where I rejected their friend requests. I don't know how diaspora does handle something like this.

There are a lot more posts. I guess this are the original posts of the reshares from the pending/rejected diaspora contacts.
I can't be totally sure because testing 2000 posts by hand is not doable. But I did some tests for the last 200 posts and the result seems to prove the assumption.
Another update (which reinforces the thesis).

if a user presses the reject contact request a post call to with a "request_id" (it is the id of the intro in the intro table). To make it short, the reject contact request button deletes the intro in the intro table and the pending contact in the contact table (see /mod/notifications.php).

I don't know if something needs to be commited to the diaspora server so that they know that we have rejected their request and would stop sending us messages.
Diaspora doesn't know the concept of rejected contact requests. If I want to follow you then I will follow you. But only if you add me in your aspects then I will get the non public postings.

BTW: Pull request is done: https://github.com/friendica/friendica/pull/3161

It adds some logging so that you can detect the origin of a post.
Thank you. I will have a look at this.
Sounds there's also some space for improvements for Diaspora as well. They can reduce the traffic and spare the bandwith and computing time when they don't send out the messages. But it's their decision for sure.