From cfc984345e90b2960077956858606395f37ef9b9 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Sep 2023 15:35:04 +0200 Subject: [PATCH 1/7] fix(back): only try to insert activities for groups Signed-off-by: Thomas Citharel --- lib/service/activity/participant.ex | 33 +++++++++++++++++------------ 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/service/activity/participant.ex b/lib/service/activity/participant.ex index 791e67fff..2a23bdc26 100644 --- a/lib/service/activity/participant.ex +++ b/lib/service/activity/participant.ex @@ -22,20 +22,25 @@ defmodule Mobilizon.Service.Activity.Participant do event = Events.get_event!(event_id) subject = Keyword.fetch!(options, :subject) - ActivityBuilder.enqueue(:build_activity, %{ - "type" => "event", - "subject" => subject, - "subject_params" => %{ - actor_name: Actor.display_name(actor), - event_title: event.title, - event_uuid: event.uuid - }, - "group_id" => event.attributed_to_id, - "author_id" => actor.id, - "object_type" => "participant", - "object_id" => participant_id, - "inserted_at" => DateTime.utc_now() - }) + if is_nil(event.attributed_to_id) do + # No activity for non-group events + {:ok, nil} + else + ActivityBuilder.enqueue(:build_activity, %{ + "type" => "event", + "subject" => subject, + "subject_params" => %{ + actor_name: Actor.display_name(actor), + event_title: event.title, + event_uuid: event.uuid + }, + "group_id" => event.attributed_to_id, + "author_id" => actor.id, + "object_type" => "participant", + "object_id" => participant_id, + "inserted_at" => DateTime.utc_now() + }) + end end @impl Activity From 31b2d065a904453580731133cd3dfd545a5816fa Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Sep 2023 15:52:27 +0200 Subject: [PATCH 2/7] fix(front): fix getting result from interactable object in InteractView Signed-off-by: Thomas Citharel --- js/src/views/InteractView.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/src/views/InteractView.vue b/js/src/views/InteractView.vue index e8be781d7..ef63cbdfc 100644 --- a/js/src/views/InteractView.vue +++ b/js/src/views/InteractView.vue @@ -68,7 +68,13 @@ const { onResult, onError, loading } = useQuery<{ }) ); -onResult(async ({ data: { interact } }) => { +onResult(async (result) => { + if (result.loading) return; + if (!result.data) { + errors.push(t("This URL is not supported")); + return; + } + const interact = result.data.interact; switch (interact.__typename) { case "Group": await router.replace({ From 8c14ba441c6f0fadb3c59f80ff4e3abb2e625752 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Sep 2023 15:55:13 +0200 Subject: [PATCH 3/7] fix(front): don't return promise if result is not finished loading for tags Signed-off-by: Thomas Citharel --- js/src/composition/apollo/tags.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/src/composition/apollo/tags.ts b/js/src/composition/apollo/tags.ts index 252cd1013..da9c06835 100644 --- a/js/src/composition/apollo/tags.ts +++ b/js/src/composition/apollo/tags.ts @@ -11,7 +11,12 @@ export function fetchTags(text: string): Promise { }) ); - onResult(({ data }) => resolve(data.tags)); + onResult((result) => { + if (result.loading) { + return; + } + return resolve(result.data.tags); + }); onError((error) => reject(error)); }); From 92b222b091cf6248969b0206e7c052b725a1286b Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Sep 2023 16:03:45 +0200 Subject: [PATCH 4/7] fix(back): allow any other type of actor to be suspended Signed-off-by: Thomas Citharel --- lib/service/actor_suspension.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/service/actor_suspension.ex b/lib/service/actor_suspension.ex index b5531a9d3..00062563e 100644 --- a/lib/service/actor_suspension.ex +++ b/lib/service/actor_suspension.ex @@ -103,7 +103,7 @@ defmodule Mobilizon.Service.ActorSuspension do end) end - defp maybe_reset_actor_id(%Multi{} = multi, %Actor{type: :Group} = _actor) do + defp maybe_reset_actor_id(%Multi{} = multi, %Actor{type: _} = _actor) do multi end From 23adeaee47a9a558c2498e3b3c54f62daea544ac Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Sep 2023 16:33:41 +0200 Subject: [PATCH 5/7] ci(release): bump release buildpack to 1.15.5-erlang-26.0.2-debian-buster Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27029a5a4..d639430be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -290,7 +290,7 @@ build-and-push-docker-tag: # Packaging app for amd64 package-app: - image: mobilizon/buildpack:1.14.1-erlang-25.1.1-debian-buster + image: mobilizon/buildpack:1.15.5-erlang-26.0.2-debian-buster stage: package variables: &release-variables MIX_ENV: "prod" From 2881717f6d9686c4efd386a504e67b5d05b4b8f4 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Sep 2023 16:36:22 +0200 Subject: [PATCH 6/7] chore(release): release 3.2.0-beta.4 Signed-off-by: Thomas Citharel --- CHANGELOG.md | 12 ++++++++++++ js/package.json | 2 +- mix.exs | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5157082b8..cefc1f5f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +# 3.2.0-beta.4 (2023-09-05) + + +### Bug Fixes + +* **back:** allow any other type of actor to be suspended ([92b222b](https://framagit.org/framasoft/mobilizon/commit/92b222b091cf6248969b0206e7c052b725a1286b)) +* **back:** only try to insert activities for groups ([cfc9843](https://framagit.org/framasoft/mobilizon/commit/cfc984345e90b2960077956858606395f37ef9b9)) +* **front:** don't return promise if result is not finished loading for tags ([8c14ba4](https://framagit.org/framasoft/mobilizon/commit/8c14ba441c6f0fadb3c59f80ff4e3abb2e625752)) +* **front:** fix getting result from interactable object in InteractView ([31b2d06](https://framagit.org/framasoft/mobilizon/commit/31b2d065a904453580731133cd3dfd545a5816fa)) + + ## 3.2.0-beta.3 (2023-09-04) diff --git a/js/package.json b/js/package.json index 0bb31ba54..a7143f2ef 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "mobilizon", - "version": "3.2.0-beta.3", + "version": "3.2.0-beta.4", "private": true, "scripts": { "dev": "vite", diff --git a/mix.exs b/mix.exs index 1303ca8ac..59b1c74e0 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Mobilizon.Mixfile do use Mix.Project - @version "3.2.0-beta.3" + @version "3.2.0-beta.4" def project do [ From a8ddc90ea2b3feff281ae67de44b041bd4921901 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 5 Sep 2023 16:37:01 +0200 Subject: [PATCH 7/7] chore(release): fix a typo in CHANGELOG.md Signed-off-by: Thomas Citharel --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cefc1f5f8..44c1e3e8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# 3.2.0-beta.4 (2023-09-05) +## 3.2.0-beta.4 (2023-09-05) ### Bug Fixes