[twitter] Fix direct reshare id source #1036

Closed
MrPetovan wants to merge 1 commit from bug/fatal-errors into develop
MrPetovan commented 2020-10-15 17:16:56 +02:00 (Migrated from github.com)

Addresses https://github.com/friendica/friendica/issues/9250#issuecomment-709238399

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.

Addresses https://github.com/friendica/friendica/issues/9250#issuecomment-709238399 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 (Migrated from github.com) reviewed 2020-10-15 17:16:56 +02:00
annando commented 2020-10-15 18:00:20 +02:00 (Migrated from github.com)

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.

`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 commented 2020-10-15 19:34:20 +02:00 (Migrated from github.com)

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?

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 commented 2020-10-15 20:31:45 +02:00 (Migrated from github.com)

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

No `thr-parent` value in my `item` table is in the `twitter:XXXXXX` form, so this will probably fail?
MrPetovan commented 2020-10-16 03:47:54 +02:00 (Migrated from github.com)

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.

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 commented 2020-10-16 06:10:27 +02:00 (Migrated from github.com)
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.

``` 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 commented 2020-10-16 06:23:05 +02:00 (Migrated from github.com)

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.

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 commented 2020-10-16 06:53:18 +02:00 (Migrated from github.com)

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;
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 commented 2020-10-16 07:36:09 +02:00 (Migrated from github.com)
+---------+---------+----------------------------------------------------------------------------+------------------------------+------------------------------+---------+
| 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    |
+---------+---------+----------------------------------------------------------------------------+------------------------------+------------------------------+---------+
``` +---------+---------+----------------------------------------------------------------------------+------------------------------+------------------------------+---------+ | 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 commented 2020-10-16 21:30:54 +02:00 (Migrated from github.com)

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

Can I somehow get rid of that blocking reshare? having no worker is not much fun...
annando commented 2020-10-16 22:31:31 +02:00 (Migrated from github.com)

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

Well, you could simply set the "workerqueue" entry as "done",
MrPetovan commented 2020-10-16 22:32:48 +02:00 (Migrated from github.com)

How would he identify the correct workerqueue entry?

How would he identify the correct workerqueue entry?
annando commented 2020-10-17 07:11:26 +02:00 (Migrated from github.com)

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.

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 commented 2020-10-17 11:28:57 +02:00 (Migrated from github.com)

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

No.

> Possibly just deactivating the Twitter addon for a while could work as well. No.
annando commented 2020-10-17 13:59:26 +02:00 (Migrated from github.com)

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

Could comment out the `twitter_retweet` line in the twitter addon, so that we do have time searching for a good solution?
tobiasd commented 2020-10-17 16:20:08 +02:00 (Migrated from github.com)

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

Ok, will do. As there is no posting to Twitter intended, this should be fine I guess.
tobiasd commented 2020-10-29 07:13:58 +01:00 (Migrated from github.com)

Any news about this?

Any news about this?
tobiasd commented 2020-11-27 07:10:48 +01:00 (Migrated from github.com)

What about this issue? Any news?

What about this issue? Any news?
MrPetovan commented 2020-11-28 23:03:42 +01:00 (Migrated from github.com)
Superseded by https://github.com/friendica/friendica-addons/pull/1048

Pull request closed

Sign in to join this conversation.
No description provided.