From cfda414277aa04b6e928e0ac0c237f656cc75d8c Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Fri, 7 Jul 2023 19:50:44 +0000 Subject: [PATCH] export: Include huddles subscription from mirrordummy users. If there are two huddles, with users A + B + C + D and A + B + C, and user D is deleted, it is replaced with a mirrordummy user. If mirrordummy subscriptions are not included in exports, then the two huddles have duplicate member sets, and will not be able to be imported successfully. Include huddle subscriptions for mirrordummy users in exports. --- zerver/lib/export.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zerver/lib/export.py b/zerver/lib/export.py index 385aaaaa6d..695f663aed 100644 --- a/zerver/lib/export.py +++ b/zerver/lib/export.py @@ -1101,7 +1101,9 @@ def fetch_reaction_data(response: TableData, message_ids: Set[int]) -> None: def custom_fetch_huddle_objects(response: TableData, context: Context) -> None: realm = context["realm"] - user_profile_ids = {r["id"] for r in response["zerver_userprofile"]} + user_profile_ids = { + r["id"] for r in response["zerver_userprofile"] + response["zerver_userprofile_mirrordummy"] + } # First we get all huddles involving someone in the realm. realm_huddle_subs = Subscription.objects.select_related("recipient").filter(