fix: don't refetch Threads avatars whose signed URL changed (v2.13.0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-10 12:21:03 -07:00
1 parent 55ce6a1fdd
commit d400e4d838
3 files changed
+34 -2

No files matched your search

+22
View File
@@ -540,3 +540,25 @@ def test_admin_backfill_and_check_now(app, client):
backfeed.denied["gotosocial"] = "Needs a GoToSocial token with read:statuses"
assert "Needs a GoToSocial token" in browser.get("/admin/webmentions?origin=gotosocial").get_data(as_text=True)
def test_threads_avatar_kept_while_its_copy_exists(app, client, web):
note, _ = crossposted(app)
with app.app_context():
get_db(app).execute("UPDATE syndications SET target = 'threads'")
get_db(app).commit()
syndication._client_cache["threads"] = client
app.config["THREADS_ACCESS_TOKEN"] = "token"
web.files["https://cdn.example/p.jpg?sig=1"] = png()
first = reply(1)
first.author_photo = "https://cdn.example/p.jpg?sig=1"
client.harvest = Harvest([first])
run(app)
with app.app_context():
get_db(app).execute("UPDATE syndications SET backfeed_next_at = datetime('now')")
get_db(app).commit()
again = reply(1)
again.author_photo = "https://cdn.example/p.jpg?sig=2" # not fetchable: would be a refetch
client.harvest = Harvest([again])
run(app)
assert rows(app, note.id)[0]["author_photo"] == "https://cdn.example/p.jpg?sig=1"