fix(instances): record the instance when refreshing known users too

Hosts without a row (IPv6 literals skipped by the backfill, rows deleted
later) were never added again, because known users take the update path.
This commit is contained in:
Lain Soykaf 2026-10-29 10:42:46 +04:00
commit 1849356abe
No known key found for this signature in database
2 changed files with 15 additions and 5 deletions

View file

@ -193,6 +193,15 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
Repo.get_by(Pleroma.Instances.Instance, host: "mastodon.example.org")
end
test "it records the instance of a known user when refreshing it" do
insert(:user, local: false, ap_id: "http://mastodon.example.org/users/admin")
refute Repo.get_by(Pleroma.Instances.Instance, host: "mastodon.example.org")
{:ok, _user} = ActivityPub.make_user_from_ap_id("http://mastodon.example.org/users/admin")
assert Repo.get_by(Pleroma.Instances.Instance, host: "mastodon.example.org")
end
test "it keeps an existing instance record" do
unreachable_since = ~N[2020-01-01 00:00:00.000000]
insert(:instance, host: "mastodon.example.org", unreachable_since: unreachable_since)