2
0
mirror of https://github.com/codl/forget synced 2024-12-29 08:30:38 +01:00

fix newer twitter accounts not fetching new posts after the initial fetch

twitter returns the post on the max_id boundary, which mastodon does not
do. the code that decides to move from historical fetch to a new batch
assumes that no posts will be returned at all when we're done, but in
twitter's case that will never happen, or not until the oldest post is
deleted. this change updates that code to ignore any posts returned that
match either max_id or since_id
This commit is contained in:
codl 2019-08-28 11:23:11 +02:00
parent 387b287990
commit 249842ed9f
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,7 @@
## next
* fix: newer twitter accounts not fetching new posts past the initial historical fetch
## v1.6.1
Released 2019-07-23

View File

@ -157,7 +157,11 @@ def fetch_acc(id_):
# ???
raise TemporaryError("Fetching posts went horribly wrong")
if len(posts) == 0:
if (
len([post for post in posts if post.remote_id not in (max_id, since_id)])
== 0
):
# if there are no posts other than the edges
# we either finished the historic fetch
# or we finished the current batch
account.fetch_history_complete = True