core: fix races on member removal / delivery of their messages (#7010)

This commit is contained in:
spaced4ndy
2026-05-26 09:07:26 +00:00
committed by GitHub
parent f3abb7aa76
commit 037c05cd29
13 changed files with 173 additions and 17 deletions
@@ -33,6 +33,7 @@ import Simplex.Chat.Store.Postgres.Migrations.M20260507_relay_inactive_at
import Simplex.Chat.Store.Postgres.Migrations.M20260514_relay_request_group_link_index
import Simplex.Chat.Store.Postgres.Migrations.M20260515_delivery_job_senders
import Simplex.Chat.Store.Postgres.Migrations.M20260520_client_services
import Simplex.Chat.Store.Postgres.Migrations.M20260525_member_removed_at
import Simplex.Messaging.Agent.Store.Shared (Migration (..))
schemaMigrations :: [(String, Text, Maybe Text)]
@@ -65,7 +66,8 @@ schemaMigrations =
("20260507_relay_inactive_at", m20260507_relay_inactive_at, Just down_m20260507_relay_inactive_at),
("20260514_relay_request_group_link_index", m20260514_relay_request_group_link_index, Just down_m20260514_relay_request_group_link_index),
("20260515_delivery_job_senders", m20260515_delivery_job_senders, Just down_m20260515_delivery_job_senders),
("20260520_client_services", m20260520_client_services, Just down_m20260520_client_services)
("20260520_client_services", m20260520_client_services, Just down_m20260520_client_services),
("20260525_member_removed_at", m20260525_member_removed_at, Just down_m20260525_member_removed_at)
]
-- | The list of migrations in ascending order by date
@@ -0,0 +1,19 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Simplex.Chat.Store.Postgres.Migrations.M20260525_member_removed_at where
import Data.Text (Text)
import Text.RawString.QQ (r)
m20260525_member_removed_at :: Text
m20260525_member_removed_at =
[r|
ALTER TABLE group_members ADD COLUMN removed_at TIMESTAMPTZ;
|]
down_m20260525_member_removed_at :: Text
down_m20260525_member_removed_at =
[r|
ALTER TABLE group_members DROP COLUMN removed_at;
|]
@@ -818,7 +818,8 @@ CREATE TABLE test_chat_schema.group_members (
index_in_group bigint DEFAULT 0 NOT NULL,
member_relations_vector bytea,
relay_link bytea,
member_pub_key bytea
member_pub_key bytea,
removed_at timestamp with time zone
);