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:
parent
958166589e
commit
1849356abe
2 changed files with 15 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue