Skip to content

Commit 501ee5a

Browse files
authored
DEV: Fix test failures and an incompatibility with reactions (#234)
1 parent 7781a88 commit 501ee5a

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

app/models/concerns/discourse_activity_pub/a_p/model_callbacks.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ def performing_activity_object
9191
end
9292
self.build_activity_pub_object(attrs)
9393
when :undo
94+
return nil if !self.activity_pub_object.present?
95+
9496
activity_pub_actor
9597
.activities
9698
.where(object_id: self.activity_pub_object.id)

assets/javascripts/discourse/routes/activity-pub-actor-followers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import ActivityPubActor from "../models/activity-pub-actor";
55

66
export default class ActivityPubActorFollowers extends DiscourseRoute {
77
@service site;
8+
@service router;
89

910
queryParams = {
1011
order: { refreshModel: true },

spec/requests/admin/discourse_activity_pub/actor_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def actor_warning(key)
2121
get "/admin/plugins/ap/actor.json"
2222
expect(response.status).to eq(400)
2323
expect(response.parsed_body["errors"]).to include(
24-
"param is missing or the value is empty: model_type",
24+
"param is missing or the value is empty or invalid: model_type",
2525
)
2626
end
2727
end

spec/requests/discourse_activity_pub/authorization_controller_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
post "/ap/auth/verify"
7272
expect(response.status).to eq(400)
7373
expect(response.parsed_body["errors"].first).to include(
74-
"param is missing or the value is empty: domain",
74+
"param is missing or the value is empty or invalid: domain",
7575
)
7676
end
7777
end
@@ -81,7 +81,7 @@
8181
post "/ap/auth/verify", params: { domain: external_domain1 }
8282
expect(response.status).to eq(400)
8383
expect(response.parsed_body["errors"].first).to include(
84-
"param is missing or the value is empty: auth_type",
84+
"param is missing or the value is empty or invalid: auth_type",
8585
)
8686
end
8787
end

0 commit comments

Comments
 (0)