Reuse epoch-verified record snapshots and avoid empty push payloads

This commit is contained in:
GPT on behalf of DHH
2026-10-08 12:26:50 +02:00
parent 74381e8b58
commit bbee420097
9 changed files with 159 additions and 21 deletions
+10
View File
@@ -89,6 +89,16 @@ class Room::PushTest < ActiveSupport::TestCase
assert_includes pushed_users { post_to_designers_mentioning_kevin }, users(:kevin)
end
test "does not build notification payloads without recipients" do
Push::Subscription.delete_all
message = messages(:first)
message.expects(:plain_text_body).never
message.expects(:creator).never
Rails.configuration.x.web_push_pool.expects(:queue).never
Room::MessagePusher.new(room: message.room, message: message).push
end
private
def post_to_designers_mentioning_kevin
rooms(:designers).messages.create! body: "Hey #{mention_attachment_for(:kevin)}", client_message_id: "earth", creator: users(:david)