From 46dc19275ba537ca1854a733f4373af6b1b7e5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 20 Oct 2024 12:01:41 +0200 Subject: [PATCH] Fix the old poll votes count bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- lib/pleroma/object/updater.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pleroma/object/updater.ex b/lib/pleroma/object/updater.ex index 8fd7da0a42..27c315acb3 100644 --- a/lib/pleroma/object/updater.ex +++ b/lib/pleroma/object/updater.ex @@ -5,6 +5,7 @@ defmodule Pleroma.Object.Updater do require Pleroma.Constants + alias Pleroma.Maps alias Pleroma.Object alias Pleroma.Repo alias Pleroma.Workers.EventReminderWorker @@ -116,6 +117,7 @@ defp maybe_update_poll(to_be_updated, updated_object) do # Choices are the same, but counts are different to_be_updated |> Map.put(key, updated_object[key]) + |> Maps.put_if_present("votersCount", updated_object["votersCount"]) else # Choices (or vote type) have changed, do not allow this _ -> to_be_updated