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

[twitter] Fix direct reshare id source #1036

Closed
wants to merge 1 commit into from

Conversation

MrPetovan
Copy link
Collaborator

Addresses friendica/friendica#9250 (comment)

I looked into my DB to find the closest field that had the expected format twitter:XXXXXXXXX that the substr(..., 9) is looking for, and settled on parent-uri, but I'm not sure about it.

Please advise.

@annando
Copy link
Collaborator

annando commented Oct 15, 2020

thr-parent is the correct one. The parent-uri is the uri of the thread starting post, the thr-parent is the uri that this post directly is connected to. The thr-parent is only identical with the parent-uri when the action is done on the thread starting post.

Since retweets mostly work (I'm using them all the time), I guess the problem is most likely caused by some very special situation. We could check if the parent post does contain some content in the "extid" field that starts with "twitter:". Then this had been some mirrored Twitter post.

@tobiasd
Copy link
Collaborator

tobiasd commented Oct 15, 2020

I wanted to reshare a tweet to my followers without writing something in addition. Maybe the very special situation is that the default ACL is not public?

@MrPetovan
Copy link
Collaborator Author

No thr-parent value in my item table is in the twitter:XXXXXX form, so this will probably fail?

@MrPetovan
Copy link
Collaborator Author

I've had several direct shares work with Twitter, but I still don't get how thr-parent can be of the expected format since none of the item table rows have the correct format in thr-parent.

@annando
Copy link
Collaborator

annando commented Oct 16, 2020

select id,uid,uri,`parent-uri`,`thr-parent`,network from item where (`thr-parent` like "twitter:%" or `parent-uri`like 'twitter:%') and gravity !=0 and vid=7 and uid=1 and origin limit 10;
+----------+-----+----------------------------------------------------------------+------------------------------+------------------------------+---------+
| id       | uid | uri                                                            | parent-uri                   | thr-parent                   | network |
+----------+-----+----------------------------------------------------------------+------------------------------+------------------------------+---------+
| 32328995 |   1 | https://pirati.ca/objects/ec054ce7-205f-82e3-3f18-787905633652 | twitter::1314986911228923907 | twitter::1314986911228923907 | dfrn    |
| 32333261 |   1 | https://pirati.ca/objects/ec054ce7-175f-8319-bec1-b00191856746 | twitter::1315282370816348161 | twitter::1315282370816348161 | dfrn    |
| 32335163 |   1 | https://pirati.ca/objects/ec054ce7-165f-8331-bdd4-7e5911243149 | twitter::1314882620099043328 | twitter::1314882620099043328 | dfrn    |
| 32335879 |   1 | https://pirati.ca/objects/ec054ce7-845f-833a-5d84-902091513659 | twitter::1315216972087472129 | twitter::1315216972087472129 | dfrn    |
| 32347946 |   1 | https://pirati.ca/objects/ec054ce7-405f-8435-621c-8ad605225869 | twitter::1315604982104817664 | twitter::1315604982104817664 | dfrn    |
| 32349140 |   1 | https://pirati.ca/objects/ec054ce7-215f-8447-cdea-05b891685636 | twitter::1315305256176226308 | twitter::1315305256176226308 | dfrn    |
| 32357064 |   1 | https://pirati.ca/objects/ec054ce7-145f-849c-632c-4e2682841267 | twitter::1315630883634843649 | twitter::1315630883634843649 | dfrn    |
| 32400294 |   1 | https://pirati.ca/objects/ec054ce7-715f-8719-bf5d-999630843548 | twitter::1316289375374897153 | twitter::1316289375374897153 | dfrn    |
| 32425030 |   1 | https://pirati.ca/objects/ec054ce7-775f-887d-d82a-0c5735210716 | twitter::1316782520462057473 | twitter::1316782520462057473 | dfrn    |
| 32425187 |   1 | https://pirati.ca/objects/ec054ce7-765f-887e-530b-0ff030190642 | twitter::1316760737059008514 | twitter::1316760737059008514 | dfrn    |
+----------+-----+----------------------------------------------------------------+------------------------------+------------------------------+---------+

We need to have the original post and the matching announce activity.

@tobiasd
Copy link
Collaborator

tobiasd commented Oct 16, 2020

That query results in an empty set for me. But, guessing the default ACL applies to the direct reshare as well, it was never meant to reach Twitter, all the recipients would be on the Fediverse and Federation side of the fence.

@annando
Copy link
Collaborator

annando commented Oct 16, 2020

The vid can be different on your system. Please try the following one and adjust it to your uid:

select id,private,uri,`parent-uri`,`thr-parent`,network from item where (`thr-parent` like "twitter:%" or `parent-uri`like 'twitter:%') and gravity !=0 and vid in (select id from verb where name = 'https://www.w3.org/ns/activitystreams#Announce') and uid=1 and origin limit 10;

@tobiasd
Copy link
Collaborator

tobiasd commented Oct 16, 2020

+---------+---------+----------------------------------------------------------------------------+------------------------------+------------------------------+---------+
| id      | private | uri                                                                        | parent-uri                   | thr-parent                   | network |
+---------+---------+----------------------------------------------------------------------------+------------------------------+------------------------------+---------+
| 2428811 |       0 | https://social.diekershoff.de/objects/f3ad7b1c-185f-87df-0012-fc2657696205 | twitter::1316342050850254859 | twitter::1316342050850254859 | dfrn    |
+---------+---------+----------------------------------------------------------------------------+------------------------------+------------------------------+---------+

@tobiasd
Copy link
Collaborator

tobiasd commented Oct 16, 2020

Can I somehow get rid of that blocking reshare? having no worker is not much fun...

@annando
Copy link
Collaborator

annando commented Oct 16, 2020

Well, you could simply set the "workerqueue" entry as "done",

@MrPetovan
Copy link
Collaborator Author

How would he identify the correct workerqueue entry?

@annando
Copy link
Collaborator

annando commented Oct 17, 2020

Possibly just deactivating the Twitter addon for a while could work as well.

And for the bugfix: I think it should be enough to simply check if the uri is in the expected format (twitter:1234567890) and then to quit if this isn't the case.

@tobiasd
Copy link
Collaborator

tobiasd commented Oct 17, 2020

Possibly just deactivating the Twitter addon for a while could work as well.

No.

@annando
Copy link
Collaborator

annando commented Oct 17, 2020

Could comment out the twitter_retweet line in the twitter addon, so that we do have time searching for a good solution?

@tobiasd
Copy link
Collaborator

tobiasd commented Oct 17, 2020

Ok, will do. As there is no posting to Twitter intended, this should be fine I guess.

@tobiasd
Copy link
Collaborator

tobiasd commented Oct 29, 2020

Any news about this?

@tobiasd tobiasd added the 2020.12 label Nov 9, 2020
@tobiasd
Copy link
Collaborator

tobiasd commented Nov 27, 2020

What about this issue? Any news?

@MrPetovan
Copy link
Collaborator Author

Superseded by #1048

@MrPetovan MrPetovan closed this Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants