From 4c7dd971d0e1b49cb7f0fcc52c456935ed29a010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20H=C3=B6nig?= Date: Sun, 4 Mar 2018 14:34:58 -0500 Subject: [PATCH] embedded bots: Dispatch all config data on update event. Previously, when a user updated the config data of an embedded bot, only the updated fields were dispatched back to the client. Dispatching all config data fields makes the client updating code less brittle. --- zerver/lib/actions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index b0ebba6c1e..277a287c34 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -4443,11 +4443,12 @@ def do_update_bot_config_data(bot_profile: UserProfile, config_data: Dict[Text, Text]) -> None: for key, value in config_data.items(): set_bot_config(bot_profile, key, value) + updated_config_data = get_bot_config(bot_profile) send_event(dict(type='realm_bot', op='update', bot=dict(email=bot_profile.email, user_id=bot_profile.id, - services = [dict(config_data=config_data)], + services = [dict(config_data=updated_config_data)], ), ), bot_owner_user_ids(bot_profile))